@feedmepos/mf-order-setting 0.0.13 → 0.0.14
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/KioskSettingView-BYv2A8Xy.js +4 -0
- package/dist/{app-E2uM-UYx.js → app-vuQcAuTZ.js} +42464 -41973
- package/dist/app.js +1 -1
- package/dist/frontend/mf-order/src/main.d.ts +472 -0
- package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +12 -0
- package/dist/frontend/mf-order/src/stores/restaurant/index.d.ts +1 -0
- package/dist/frontend/mf-order/src/views/order-settings/delivery/DeliverySetting.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/delivery/inhouse/InHouseDelivery.vue.d.ts +0 -8
- package/dist/frontend/mf-order/src/views/order-settings/general/GeneralSetting.vue.d.ts +2 -0
- package/dist/frontend/mf-order/src/views/order-settings/pickup/PaymentSidesheet.vue.d.ts +2 -16
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/package/entity/booking/booking.do.d.ts +60 -1025
- package/dist/package/entity/delivery/delivery.dto.d.ts +39 -208
- package/dist/package/entity/delivery/gateway/pandago.dto.d.ts +6 -6
- package/dist/package/entity/food-court/order.dto.d.ts +1607 -13450
- package/dist/package/entity/incoming-order/incoming-order-to-bill.dto.d.ts +1413 -291
- package/dist/package/entity/incoming-order/incoming-order.do.d.ts +602 -99
- package/dist/package/entity/incoming-order/incoming-order.dto.d.ts +1182 -154
- package/dist/package/entity/kiosk/marketing/marketing.dto.d.ts +66 -875
- package/dist/package/entity/order/delivery/delivery.do.d.ts +12 -0
- package/dist/package/entity/order/menu/menu.dto.d.ts +6 -1
- package/dist/package/entity/order/order-item/order-item.dto.d.ts +847 -40
- package/dist/package/entity/order/order.do.d.ts +9 -3
- package/dist/package/entity/order/order.dto.d.ts +2639 -8399
- package/dist/package/entity/order-platform/foodpanda/foodpanda-order.dto.d.ts +12 -205
- package/dist/package/entity/order-platform/grabfood/grabfood-order.do.d.ts +12 -205
- package/dist/package/entity/order-platform/menu.dto.d.ts +48 -48
- package/dist/package/entity/order-platform/shopeefood/shopeefood-order.do.d.ts +12 -205
- package/dist/package/entity/order-setting/order-setting.do.d.ts +8 -0
- package/dist/package/entity/order-setting/order-setting.dto.d.ts +16 -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/queue/queue.do.d.ts +50 -50
- package/dist/package/entity/restaurant/restaurant.dto.d.ts +10 -0
- package/package.json +3 -2
- package/src/i18n.d.ts +11 -0
- package/src/locales/en-US.json +235 -0
- package/src/locales/zh-CN.json +235 -0
- package/src/main.ts +23 -1
- package/src/stores/restaurant/index.ts +31 -3
- package/src/stores/table-settings.ts +0 -5
- package/src/views/kiosk/KioskSummary.vue +16 -13
- package/src/views/kiosk/KioskView.vue +13 -10
- package/src/views/kiosk/devices/KioskDeviceCard.vue +10 -7
- package/src/views/kiosk/devices/KioskDevicesView.vue +6 -4
- package/src/views/kiosk/devices/KioskOtpDialog.vue +4 -1
- package/src/views/kiosk/devices/KioskUnbindConfirm.vue +3 -1
- package/src/views/kiosk/settings/KioskDineInSection.vue +4 -1
- package/src/views/kiosk/settings/KioskDisplayStandSection.vue +14 -11
- package/src/views/kiosk/settings/KioskPickAtCounterSection.vue +4 -1
- package/src/views/kiosk/settings/KioskSettingView.vue +8 -5
- package/src/views/kiosk/settings/KioskTakeawaySection.vue +4 -1
- package/src/views/order-settings/OrderSettingsView.vue +13 -7
- package/src/views/order-settings/components/RestaurantSelector.vue +5 -2
- package/src/views/order-settings/delivery/DeliverySetting.vue +113 -60
- package/src/views/order-settings/delivery/components/ManualIntegratedDeliverySetting.vue +11 -8
- package/src/views/order-settings/delivery/components/TaxInput.vue +1 -1
- package/src/views/order-settings/delivery/inhouse/CurrencyInput.vue +2 -2
- package/src/views/order-settings/delivery/inhouse/DeliveryCustomTime.vue +31 -0
- package/src/views/order-settings/delivery/inhouse/DeliveryOrder.vue +12 -9
- package/src/views/order-settings/delivery/inhouse/DeliveryTime.vue +9 -6
- package/src/views/order-settings/delivery/inhouse/InHouseDelivery.vue +63 -68
- package/src/views/order-settings/delivery/inhouse/TimePicker.vue +4 -1
- package/src/views/order-settings/delivery/inhouse/ZoneDialog.vue +7 -4
- package/src/views/order-settings/delivery/integrated-delivery/FeedmeDelivery.vue +38 -15
- package/src/views/order-settings/delivery/integrated-delivery/FoodpandaCampaignDialog.vue +7 -4
- package/src/views/order-settings/delivery/integrated-delivery/FoodpandaSetting.vue +7 -4
- package/src/views/order-settings/delivery/integrated-delivery/IntegratedDelivery.vue +99 -41
- package/src/views/order-settings/dinein/DineInSetting.vue +15 -12
- package/src/views/order-settings/dinein/OfflinePaymentTypeDialog.vue +9 -6
- package/src/views/order-settings/dinein/OfflinePaymentTypeDialogContent.vue +6 -3
- package/src/views/order-settings/dinein/PaymentType.vue +9 -6
- package/src/views/order-settings/general/GeneralSetting.vue +103 -0
- package/src/views/order-settings/pickup/AddressInput.vue +5 -2
- package/src/views/order-settings/pickup/CustomPayment.vue +10 -8
- package/src/views/order-settings/pickup/PaymentSidesheet.vue +114 -63
- package/src/views/order-settings/pickup/PickUpPointDialog.vue +7 -4
- package/src/views/order-settings/pickup/PickUpPointDialogContent.vue +7 -4
- package/src/views/order-settings/pickup/PickUpSetting.vue +13 -10
- package/src/views/order-settings/pickup/PickUpSettingDialog.vue +13 -8
- package/src/views/order-settings/pickup/PickUpSettingDialogContent.vue +37 -37
- package/src/views/order-settings/pickup/Preorder.vue +10 -8
- package/src/views/order-settings/servicecharge/RateInput.vue +12 -5
- package/src/views/order-settings/servicecharge/ServiceChargeRule.vue +44 -24
- package/src/views/order-settings/servicecharge/ServiceChargeSetting.vue +16 -13
- package/src/views/order-settings/sms/SmsSetting.vue +105 -29
- package/tsconfig.app.json +3 -1
- package/tsconfig.json +2 -1
- package/tsconfig.node.json +3 -1
- package/vite.config.ts +2 -1
- package/dist/KioskSettingView-_h6R-Crz.js +0 -4
|
@@ -3,6 +3,9 @@ import { clone } from '@/helpers/object'
|
|
|
3
3
|
import type { FdoOperatingHour, FdoOperatingHours } from '@feedmepos/core/entity'
|
|
4
4
|
import Day from 'dayjs'
|
|
5
5
|
import { computed, type PropType } from 'vue'
|
|
6
|
+
import { useI18n } from '@feedmepos/mf-common'
|
|
7
|
+
|
|
8
|
+
const { t } = useI18n()
|
|
6
9
|
|
|
7
10
|
const props = defineProps({
|
|
8
11
|
modelValue: {
|
|
@@ -145,12 +148,40 @@ function emitValue(fn: (v: FdoOperatingHour[]) => FdoOperatingHour[]) {
|
|
|
145
148
|
emits('update:model-value', v)
|
|
146
149
|
}
|
|
147
150
|
|
|
151
|
+
function convertDayToI18n(day:string) {
|
|
152
|
+
switch(day) {
|
|
153
|
+
case "Monday":
|
|
154
|
+
return t('order.monday');
|
|
155
|
+
case "Tuesday":
|
|
156
|
+
return t('order.tuesday');
|
|
157
|
+
case "Wednesday":
|
|
158
|
+
return t('order.wednesday');
|
|
159
|
+
case "Thursday":
|
|
160
|
+
return t('order.thursday');
|
|
161
|
+
case "Friday":
|
|
162
|
+
return t('order.friday');
|
|
163
|
+
case "Saturday":
|
|
164
|
+
return t('order.saturday');
|
|
165
|
+
case "Sunday":
|
|
166
|
+
return t('order.sunday');
|
|
167
|
+
default:
|
|
168
|
+
return
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
148
172
|
const sortedDayOptions = computed(() => {
|
|
149
173
|
return dayOptions.value.slice().sort((a, b) => {
|
|
150
174
|
// Sort so that 1 (Monday) comes first and 0 (Sunday) comes last
|
|
151
175
|
if (a.value === 0) return 1
|
|
152
176
|
if (b.value === 0) return -1
|
|
153
177
|
return a.value - b.value
|
|
178
|
+
}).
|
|
179
|
+
map(option => {
|
|
180
|
+
const label = convertDayToI18n(option.label)
|
|
181
|
+
return {
|
|
182
|
+
...option,
|
|
183
|
+
label
|
|
184
|
+
}
|
|
154
185
|
})
|
|
155
186
|
})
|
|
156
187
|
</script>
|
|
@@ -9,6 +9,9 @@ import GoogleMap from '@/components/GoogleMap.vue'
|
|
|
9
9
|
import ZoneDialog from './ZoneDialog.vue'
|
|
10
10
|
import { type PropType, computed, onMounted, ref } from 'vue'
|
|
11
11
|
import { useSnackbar, SnackbarPosition } from '@feedmepos/ui-library'
|
|
12
|
+
import { useI18n } from '@feedmepos/mf-common'
|
|
13
|
+
|
|
14
|
+
const { t } = useI18n()
|
|
12
15
|
|
|
13
16
|
export interface Address extends FdoAddress {
|
|
14
17
|
formatted: string
|
|
@@ -54,15 +57,15 @@ const areas = computed(() =>
|
|
|
54
57
|
const { deliveryFee, minPurchase, freeAfterTotal } = area
|
|
55
58
|
return [
|
|
56
59
|
{
|
|
57
|
-
label: '
|
|
60
|
+
label: t('order.deliveryFee'),
|
|
58
61
|
value: formatCurrency(deliveryFee)
|
|
59
62
|
},
|
|
60
63
|
{
|
|
61
|
-
label: '
|
|
64
|
+
label: t('order.minPurchase'),
|
|
62
65
|
value: minPurchase ? formatCurrency(minPurchase) : 'Not Set'
|
|
63
66
|
},
|
|
64
67
|
{
|
|
65
|
-
label: '
|
|
68
|
+
label: t('order.minSpendForFreeDelivery'),
|
|
66
69
|
value: freeAfterTotal ? formatCurrency(freeAfterTotal) : 'Not Set'
|
|
67
70
|
}
|
|
68
71
|
]
|
|
@@ -179,10 +182,10 @@ onMounted(getCenter)
|
|
|
179
182
|
<GoogleMap ref="gmRef" class="full-width" style="height: 500px" :center="center" :polygons="polygons" :zoom="10" />
|
|
180
183
|
|
|
181
184
|
<div class=" mt-5 mb-5">
|
|
182
|
-
<FmButton class="mt-3" @click="openSideSheet" icon="add" label="
|
|
185
|
+
<FmButton class="mt-3" @click="openSideSheet" icon="add" :label="t('order.addDeliveryZone')" variant="plain" />
|
|
183
186
|
</div>
|
|
184
187
|
|
|
185
|
-
<FmSideSheet header="
|
|
188
|
+
<FmSideSheet :header="t('order.addDeliveryZone')" dismiss-away :maxWidth="600" v-model="sideSheet">
|
|
186
189
|
<div v-if="currentIndex !== null">
|
|
187
190
|
<ZoneDialog :center="getPolygonCenter(deliveryArea?.polygon ?? [])" :initial-value="deliveryArea"
|
|
188
191
|
@update:model-value="handleZoneUpdate" />
|
|
@@ -194,12 +197,12 @@ onMounted(getCenter)
|
|
|
194
197
|
<template #side-sheet-footer>
|
|
195
198
|
<div class="flex gap-8 items-center justify-start">
|
|
196
199
|
<div v-if="currentIndex !== null">
|
|
197
|
-
<FmButton variant="primary" label="
|
|
200
|
+
<FmButton variant="primary" :label="t('order.save')" size="lg" @click="updateZone(currentIndex)" close: true />
|
|
198
201
|
</div>
|
|
199
202
|
<div v-else>
|
|
200
|
-
<FmButton variant="primary" label="
|
|
203
|
+
<FmButton variant="primary" :label="t('order.save')" size="lg" @click="addZone" close: true />
|
|
201
204
|
</div>
|
|
202
|
-
<FmButton variant="secondary" label="
|
|
205
|
+
<FmButton variant="secondary" :label="t('order.cancel')" size="lg" @click="closeSideSheet" />
|
|
203
206
|
</div>
|
|
204
207
|
</template>
|
|
205
208
|
</FmSideSheet>
|
|
@@ -209,7 +212,7 @@ onMounted(getCenter)
|
|
|
209
212
|
<div class="flex flex-row">
|
|
210
213
|
<div class="fm-typo-en-body-lg-600 mb-3 mr-5" :style="{
|
|
211
214
|
color: colors[index]
|
|
212
|
-
}">
|
|
215
|
+
}">{{ t('order.deliveryZone') }} {{ index + 1 }}</div>
|
|
213
216
|
|
|
214
217
|
<div class="mr-auto"></div>
|
|
215
218
|
<FmButton append-icon="edit" variant="tertiary" @click="editZone(index)" />
|
|
@@ -3,6 +3,9 @@ import type { FdoDeliveryTime, FdoOperatingHour, FdoOperatingHours } from '@feed
|
|
|
3
3
|
import { computed, ref, type PropType } from 'vue'
|
|
4
4
|
import TimePicker from './TimePicker.vue'
|
|
5
5
|
import DeliveryCustomTime from './DeliveryCustomTime.vue'
|
|
6
|
+
import { useI18n } from '@feedmepos/mf-common'
|
|
7
|
+
|
|
8
|
+
const { t } = useI18n()
|
|
6
9
|
|
|
7
10
|
type DeliveryTimeType = 'operatingHour' | 'fixed' | 'custom'
|
|
8
11
|
|
|
@@ -28,15 +31,15 @@ const deliveryTimeOptions: {
|
|
|
28
31
|
value: DeliveryTimeType
|
|
29
32
|
}[] = [
|
|
30
33
|
{
|
|
31
|
-
label: '
|
|
34
|
+
label: t('order.operatingHour'),
|
|
32
35
|
value: 'operatingHour'
|
|
33
36
|
},
|
|
34
37
|
{
|
|
35
|
-
label: '
|
|
38
|
+
label: t('order.fixedTime'),
|
|
36
39
|
value: 'fixed'
|
|
37
40
|
},
|
|
38
41
|
{
|
|
39
|
-
label: '
|
|
42
|
+
label: t('order.customTime'),
|
|
40
43
|
value: 'custom'
|
|
41
44
|
}
|
|
42
45
|
]
|
|
@@ -110,8 +113,8 @@ function canToggle(value: DeliveryTimeType) {
|
|
|
110
113
|
<div v-if="modelValue.custom && option.value === 'custom'">
|
|
111
114
|
<FmCard variant="outlined">
|
|
112
115
|
<FmCardSection>
|
|
113
|
-
<div class="flex-grow fm-typo-en-body-lg-600 mb-2">
|
|
114
|
-
<DeliveryCustomTime title="
|
|
116
|
+
<div class="flex-grow fm-typo-en-body-lg-600 mb-2">{{ t('order.timeSlot') }}</div>
|
|
117
|
+
<DeliveryCustomTime :title="t('order.timeSlot')" :model-value="modelValue.custom"
|
|
115
118
|
@update:model-value="updateCustomTime" />
|
|
116
119
|
</FmCardSection>
|
|
117
120
|
</FmCard>
|
|
@@ -120,7 +123,7 @@ function canToggle(value: DeliveryTimeType) {
|
|
|
120
123
|
<div v-if="modelValue.time && option.value === 'fixed'">
|
|
121
124
|
<FmCard variant="outlined">
|
|
122
125
|
<FmCardSection>
|
|
123
|
-
<div class="flex-grow fm-typo-en-body-lg-600 mb-2">
|
|
126
|
+
<div class="flex-grow fm-typo-en-body-lg-600 mb-2">{{ t('order.timeSlot') }}</div>
|
|
124
127
|
<TimePicker :modelValue="props.modelValue" @update:model-value="(v) => emits('update:model-value', v)" />
|
|
125
128
|
</FmCardSection>
|
|
126
129
|
</FmCard>
|
|
@@ -21,6 +21,10 @@ import { Pos } from '@feedmepos/core'
|
|
|
21
21
|
import TaxInput from '../components/TaxInput.vue'
|
|
22
22
|
import { useCoreStore } from '@feedmepos/mf-common'
|
|
23
23
|
import { useSnackbar } from '@feedmepos/ui-library'
|
|
24
|
+
import { useI18n } from '@feedmepos/mf-common'
|
|
25
|
+
import { useRestaurantStore } from '@/stores/restaurant'
|
|
26
|
+
|
|
27
|
+
const { t } = useI18n()
|
|
24
28
|
|
|
25
29
|
export interface InhouseDialogData {
|
|
26
30
|
enable: boolean
|
|
@@ -34,6 +38,8 @@ export interface InhouseDialogData {
|
|
|
34
38
|
taxes: { [key: string]: FdoDeliveryTaxSetting }
|
|
35
39
|
}
|
|
36
40
|
|
|
41
|
+
const restaurantStore = useRestaurantStore()
|
|
42
|
+
|
|
37
43
|
enum TaxOption {
|
|
38
44
|
inclusive,
|
|
39
45
|
exclusive
|
|
@@ -41,11 +47,11 @@ enum TaxOption {
|
|
|
41
47
|
|
|
42
48
|
const taxInclusiveOptions = [
|
|
43
49
|
{
|
|
44
|
-
label: '
|
|
50
|
+
label: `${t('order.taxInclusive')}`,
|
|
45
51
|
value: TaxOption.inclusive
|
|
46
52
|
},
|
|
47
53
|
{
|
|
48
|
-
label: '
|
|
54
|
+
label: `${t('order.taxExclusive')}`,
|
|
49
55
|
value: TaxOption.exclusive
|
|
50
56
|
}
|
|
51
57
|
]
|
|
@@ -53,15 +59,10 @@ const taxInclusiveOptions = [
|
|
|
53
59
|
const snackBar = useSnackbar()
|
|
54
60
|
const { currentRestaurant } = useCoreStore()
|
|
55
61
|
const minVersionForTax = Pos.minVersionToUse(F_FEATURE.Enum.calculatorV4)
|
|
56
|
-
const
|
|
62
|
+
const validPosVersion = computed<boolean>(() => {
|
|
57
63
|
const posVersion = currentRestaurant.value?.posVersion ?? ''
|
|
58
64
|
const feature = F_FEATURE.Enum.calculatorV4
|
|
59
|
-
|
|
60
|
-
if (!res) {
|
|
61
|
-
const minVersion = Pos.minVersionToUse(feature)
|
|
62
|
-
return `*POS version ${minVersion} or above`
|
|
63
|
-
}
|
|
64
|
-
return ''
|
|
65
|
+
return Pos.canUse({ feature, posVersion })
|
|
65
66
|
})
|
|
66
67
|
|
|
67
68
|
const props = defineProps({
|
|
@@ -69,10 +70,6 @@ const props = defineProps({
|
|
|
69
70
|
type: Object as PropType<InhouseDialogData>,
|
|
70
71
|
default: undefined
|
|
71
72
|
},
|
|
72
|
-
allowEPayment: {
|
|
73
|
-
type: [Boolean, String] as PropType<boolean | string>,
|
|
74
|
-
required: true
|
|
75
|
-
},
|
|
76
73
|
address: {
|
|
77
74
|
type: Object as PropType<Address | undefined>,
|
|
78
75
|
required: true
|
|
@@ -83,16 +80,16 @@ const inhouse = reactive<InhouseDialogData>(
|
|
|
83
80
|
props.initialValue
|
|
84
81
|
? clone(props.initialValue)
|
|
85
82
|
: {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
83
|
+
enable: false,
|
|
84
|
+
catalogId: null,
|
|
85
|
+
term: '',
|
|
86
|
+
areas: [],
|
|
87
|
+
ignoreStock: false,
|
|
88
|
+
paymentTypes: [],
|
|
89
|
+
offlinePaymentTypes: [],
|
|
90
|
+
deliveryTime: null,
|
|
91
|
+
taxes: {}
|
|
92
|
+
}
|
|
96
93
|
)
|
|
97
94
|
|
|
98
95
|
const tax = computed(() => ItemTax.taxSetting())
|
|
@@ -190,8 +187,13 @@ function updateTerm(value: string) {
|
|
|
190
187
|
emitUpdatedValue()
|
|
191
188
|
}
|
|
192
189
|
|
|
193
|
-
function
|
|
194
|
-
|
|
190
|
+
function updatePayment(value: {
|
|
191
|
+
paymentTypes: F_ORDER_PAYMENT_TYPE[]
|
|
192
|
+
offlinePaymentTypes: FdoOfflinePaymentMethod[] | undefined | null
|
|
193
|
+
}) {
|
|
194
|
+
inhouse.offlinePaymentTypes = value.offlinePaymentTypes
|
|
195
|
+
inhouse.paymentTypes = value.paymentTypes
|
|
196
|
+
emitUpdatedValue()
|
|
195
197
|
}
|
|
196
198
|
|
|
197
199
|
watch(
|
|
@@ -228,23 +230,22 @@ const actualDeliveryTime = computed({
|
|
|
228
230
|
</script>
|
|
229
231
|
|
|
230
232
|
<template>
|
|
231
|
-
<FmSwitch
|
|
232
|
-
:model-value="inhouse.enable"
|
|
233
|
-
label="
|
|
233
|
+
<FmSwitch
|
|
234
|
+
:model-value="inhouse.enable"
|
|
235
|
+
:label="t('order.activateDeliveryCompany', {company:'In house'})"
|
|
234
236
|
label-placement="right"
|
|
235
|
-
sublabel="
|
|
236
|
-
@update:model-value="updateEnable"
|
|
237
|
-
/>
|
|
237
|
+
:sublabel="t('order.inhouseSwitchSublabel')"
|
|
238
|
+
@update:model-value="updateEnable" />
|
|
238
239
|
<div v-if="inhouse.enable">
|
|
239
240
|
<FmCard variant="outlined" class="p-5 mt-10">
|
|
240
|
-
<div class="flex-grow fm-typo-en-title-sm-600 mb-3">
|
|
241
|
+
<div class="flex-grow fm-typo-en-title-sm-600 mb-3">{{ t('order.generalSetting') }}</div>
|
|
241
242
|
|
|
242
243
|
<div class="mb-5">
|
|
243
244
|
<FmSwitch
|
|
244
245
|
:model-value="inhouse.ignoreStock || false"
|
|
245
246
|
value="ignoreStock"
|
|
246
|
-
label="
|
|
247
|
-
sublabel="
|
|
247
|
+
:label="t('order.ignoreStock')"
|
|
248
|
+
:sublabel="t('order.ignoreStockSublabel')"
|
|
248
249
|
label-placement="right"
|
|
249
250
|
@update:model-value="updateIgnoreStock"
|
|
250
251
|
/>
|
|
@@ -253,7 +254,7 @@ const actualDeliveryTime = computed({
|
|
|
253
254
|
<div class="mb-5">
|
|
254
255
|
<FmSelect
|
|
255
256
|
:model-value="inhouse.catalogId"
|
|
256
|
-
label="
|
|
257
|
+
:label="t('order.catalog')"
|
|
257
258
|
:items="menuStore.catalogOptions"
|
|
258
259
|
@update:model-value="updateCatalogId"
|
|
259
260
|
/>
|
|
@@ -262,7 +263,7 @@ const actualDeliveryTime = computed({
|
|
|
262
263
|
<div class="mb-5">
|
|
263
264
|
<FmTextarea
|
|
264
265
|
:model-value="inhouse.term"
|
|
265
|
-
label="
|
|
266
|
+
:label="t('order.deliveryTerm')"
|
|
266
267
|
@update:model-value="updateTerm"
|
|
267
268
|
/>
|
|
268
269
|
</div>
|
|
@@ -270,41 +271,41 @@ const actualDeliveryTime = computed({
|
|
|
270
271
|
|
|
271
272
|
<FmCard variant="outlined" class="p-5 mt-10">
|
|
272
273
|
<div class="flex-grow fm-typo-en-title-sm-600 mb-3">
|
|
273
|
-
|
|
274
|
+
{{ t('order.taxSetting') }}
|
|
274
275
|
<span
|
|
275
276
|
class="text-fm-color-secondary-salmon fm-typo-en-body-sm-600"
|
|
276
|
-
v-if="
|
|
277
|
+
v-if="!validPosVersion"
|
|
277
278
|
>
|
|
278
|
-
(
|
|
279
|
+
{{ t('order.taxSettingTerm', {validatePosVersion: minVersionForTax}) }}</span
|
|
279
280
|
>
|
|
280
281
|
</div>
|
|
281
282
|
<div class="mb-5">
|
|
282
|
-
<FmSwitch
|
|
283
|
-
:model-value="hasInhouseDeliveryTax"
|
|
284
|
-
:disabled="
|
|
285
|
-
label="
|
|
286
|
-
label-placement="right"
|
|
287
|
-
sublabel="
|
|
288
|
-
@update:model-value="toggleTax"
|
|
289
|
-
/>
|
|
283
|
+
<FmSwitch
|
|
284
|
+
:model-value="hasInhouseDeliveryTax && validPosVersion"
|
|
285
|
+
:disabled="!validPosVersion"
|
|
286
|
+
:label="t('order.inhouseDeliveryTaxLabel')"
|
|
287
|
+
label-placement="right"
|
|
288
|
+
:sublabel="t('order.inhouseDeliveryTaxSublabel')"
|
|
289
|
+
@update:model-value="toggleTax" />
|
|
290
290
|
</div>
|
|
291
|
-
<div v-if="hasInhouseDeliveryTax">
|
|
291
|
+
<div v-if="hasInhouseDeliveryTax && validPosVersion">
|
|
292
292
|
<div class="mb-5">
|
|
293
|
-
<TaxInput
|
|
294
|
-
:
|
|
293
|
+
<TaxInput
|
|
294
|
+
:disable="!validPosVersion"
|
|
295
|
+
:model-value="taxSettings"
|
|
295
296
|
:tax-options="taxOptions"
|
|
296
|
-
:title="`${tax.systemCode} (
|
|
297
|
-
@update:model-value="(ev) => updateTax(ev)"
|
|
297
|
+
:title="`${tax.systemCode} ${t('order.inhouseDeliveryInputLabel')}`"
|
|
298
|
+
@update:model-value="(ev) => updateTax(ev)"
|
|
298
299
|
/>
|
|
299
300
|
</div>
|
|
300
301
|
<div class="mb-5">
|
|
301
|
-
<FmRadioGroup
|
|
302
|
-
:
|
|
303
|
-
|
|
302
|
+
<FmRadioGroup
|
|
303
|
+
:disabled="!validPosVersion"
|
|
304
|
+
:model-value="taxInclusive"
|
|
305
|
+
label-mark="required"
|
|
304
306
|
inline
|
|
305
|
-
label="
|
|
306
|
-
@update:model-value="(ev) => updateTaxInclusive(ev as unknown as number)"
|
|
307
|
-
>
|
|
307
|
+
:label="t('order.inhouseDeliveryTaxCalculation')"
|
|
308
|
+
@update:model-value="(ev) => updateTaxInclusive(ev as unknown as number)">
|
|
308
309
|
<div v-for="option in taxInclusiveOptions" :key="option.value">
|
|
309
310
|
<FmRadio :value="option.value" :label="option.label" />
|
|
310
311
|
</div>
|
|
@@ -314,14 +315,8 @@ const actualDeliveryTime = computed({
|
|
|
314
315
|
</FmCard>
|
|
315
316
|
|
|
316
317
|
<FmCard variant="outlined" class="p-5 mt-10">
|
|
317
|
-
<PaymentSidesheet
|
|
318
|
-
:
|
|
319
|
-
:offlinePaymentTypes="inhouse.offlinePaymentTypes"
|
|
320
|
-
@update:payment-types="(v: F_ORDER_PAYMENT_TYPE[]) => updatePaymentTypes(v)"
|
|
321
|
-
@update:offline-payment-types="
|
|
322
|
-
(v: FdoOfflinePaymentMethod[] | undefined | null) => (inhouse.offlinePaymentTypes = v)
|
|
323
|
-
"
|
|
324
|
-
/>
|
|
318
|
+
<PaymentSidesheet :paymentTypes="inhouse.paymentTypes" :offlinePaymentTypes="inhouse.offlinePaymentTypes"
|
|
319
|
+
:allow-e-payment="restaurantStore.getRestaurantEPayment(currentRestaurant)" @update:payments="updatePayment" />
|
|
325
320
|
</FmCard>
|
|
326
321
|
|
|
327
322
|
<FmCard variant="outlined" class="p-5 mt-10">
|
|
@@ -330,12 +325,12 @@ const actualDeliveryTime = computed({
|
|
|
330
325
|
|
|
331
326
|
<div v-if="preorderDeliveryTime">
|
|
332
327
|
<FmCard variant="outlined" class="p-5 mt-10">
|
|
333
|
-
<div class="flex-grow fm-typo-en-title-sm-600">
|
|
328
|
+
<div class="flex-grow fm-typo-en-title-sm-600">{{ t('order.deliveryTime') }}</div>
|
|
334
329
|
<DeliveryTime v-model="actualDeliveryTime as FdoDeliveryTime" />
|
|
335
330
|
</FmCard>
|
|
336
331
|
</div>
|
|
337
332
|
<FmCard variant="outlined" class="p-5 mt-10">
|
|
338
|
-
<div class="flex-grow fm-typo-en-title-sm-600 mb-3">
|
|
333
|
+
<div class="flex-grow fm-typo-en-title-sm-600 mb-3">{{ t('order.deliveryOrder') }}</div>
|
|
339
334
|
<DeliveryOrder v-model="inhouse.areas" :address="address as Address" />
|
|
340
335
|
</FmCard>
|
|
341
336
|
</div>
|
|
@@ -15,13 +15,16 @@
|
|
|
15
15
|
<FmButton class="mt-2 ml-4" append-icon="close" variant="tertiary" @click="removeTimeslot(index)" />
|
|
16
16
|
</div>
|
|
17
17
|
</div>
|
|
18
|
-
<FmButton class="mt-3" @click.stop="addTimeslot" icon="add" label="
|
|
18
|
+
<FmButton class="mt-3" @click.stop="addTimeslot" icon="add" :label="t('order.addTimeSlot')" variant="plain"/>
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
21
|
<script setup lang="ts">
|
|
22
22
|
import { computed } from 'vue'
|
|
23
23
|
import Day from 'dayjs'
|
|
24
24
|
import type { FdoDeliveryTime } from '@feedmepos/core/entity'
|
|
25
|
+
import { useI18n } from '@feedmepos/mf-common'
|
|
26
|
+
|
|
27
|
+
const { t } = useI18n()
|
|
25
28
|
|
|
26
29
|
const props = defineProps<{
|
|
27
30
|
modelValue: FdoDeliveryTime
|
|
@@ -7,6 +7,9 @@ import { Dinero } from '@feedmepos/core'
|
|
|
7
7
|
import type { FdoDeliveryArea, FdoDinero } from '@feedmepos/core/entity'
|
|
8
8
|
import { ref, reactive, type PropType, computed, onMounted, watch } from 'vue'
|
|
9
9
|
import CurrencyInput from './CurrencyInput.vue'
|
|
10
|
+
import { useI18n } from '@feedmepos/mf-common'
|
|
11
|
+
|
|
12
|
+
const { t } = useI18n()
|
|
10
13
|
|
|
11
14
|
const emits = defineEmits<{
|
|
12
15
|
(e: 'update:model-value', value: FdoDeliveryArea): void
|
|
@@ -101,28 +104,28 @@ watch(
|
|
|
101
104
|
<CurrencyInput
|
|
102
105
|
:model-value="data.deliveryFee"
|
|
103
106
|
@update:model-value="updateDeliveryFee"
|
|
104
|
-
label="
|
|
107
|
+
:label="t('order.deliveryFee')"
|
|
105
108
|
/>
|
|
106
109
|
<div class="flex flex-row">
|
|
107
110
|
<div class="mr-1">
|
|
108
111
|
<CurrencyInput
|
|
109
112
|
:model-value="data.minPurchase"
|
|
110
113
|
@update:model-value="updateMinPurchase"
|
|
111
|
-
label="
|
|
114
|
+
:label="t('order.minPurchase')"
|
|
112
115
|
/>
|
|
113
116
|
</div>
|
|
114
117
|
<div class="ml-1">
|
|
115
118
|
<CurrencyInput
|
|
116
119
|
:model-value="data.freeAfterTotal"
|
|
117
120
|
@update:model-value="updateFreeAfterTotal"
|
|
118
|
-
label="
|
|
121
|
+
:label="t('order.minSpendForFreeDelivery')"
|
|
119
122
|
/>
|
|
120
123
|
</div>
|
|
121
124
|
</div>
|
|
122
125
|
<FmStepperField
|
|
123
126
|
class="mb-5"
|
|
124
127
|
:model-value="distanceInKM"
|
|
125
|
-
label="
|
|
128
|
+
:label="`${t('order.deliveryZone')} (km)`"
|
|
126
129
|
placeholder="0"
|
|
127
130
|
:show-steppers="false"
|
|
128
131
|
@update:model-value="updateDistance"
|
|
@@ -10,6 +10,10 @@ import {
|
|
|
10
10
|
import { useCoreStore } from '@feedmepos/mf-common'
|
|
11
11
|
import { type PropType, computed, reactive } from 'vue'
|
|
12
12
|
import parsePhoneNumberFromString from 'libphonenumber-js'
|
|
13
|
+
import { useI18n } from '@feedmepos/mf-common'
|
|
14
|
+
|
|
15
|
+
import { useRouter } from 'vue-router'
|
|
16
|
+
const { t } = useI18n()
|
|
13
17
|
|
|
14
18
|
interface ValidateFeedmeErrorResult {
|
|
15
19
|
message: string
|
|
@@ -51,23 +55,30 @@ const validatePosVersion = computed<ValidateFeedmeResult>(() => {
|
|
|
51
55
|
})
|
|
52
56
|
if (!res) {
|
|
53
57
|
const minVersion = Pos.minVersionToUse(F_FEATURE.enum.feedmeDelivery)
|
|
54
|
-
return { message:
|
|
58
|
+
return { message: `${t('order.feedmeExpressPosVersionIssue', {minVersion})}` }
|
|
55
59
|
}
|
|
56
60
|
return true
|
|
57
61
|
})
|
|
58
62
|
|
|
63
|
+
const router = useRouter();
|
|
64
|
+
|
|
59
65
|
const validatePayoutAccount = computed<ValidateFeedmeResult>(() => {
|
|
60
66
|
const account = currentRestaurant.value?.payoutAccount
|
|
61
67
|
if (!account?.enable) {
|
|
62
68
|
return {
|
|
63
|
-
message:
|
|
64
|
-
|
|
69
|
+
message: `${t('order.feedmeExpressPayoutAccIssue')}`,
|
|
70
|
+
action: {
|
|
71
|
+
label: t('order.updatePayoutAccount'),
|
|
72
|
+
callback: () => {
|
|
73
|
+
router.push({ name: "mf-payment-payout-account"})
|
|
74
|
+
}
|
|
75
|
+
}
|
|
65
76
|
}
|
|
66
77
|
}
|
|
67
78
|
if (account.status !== F_PAYOUT_ACCOUNT_STATUS.enum.APPROVED) {
|
|
68
79
|
return {
|
|
69
80
|
message:
|
|
70
|
-
'
|
|
81
|
+
`${t('order.feedmeExpressNotApproved')}`
|
|
71
82
|
}
|
|
72
83
|
}
|
|
73
84
|
return true
|
|
@@ -77,12 +88,18 @@ const validateRestaurantProfile = computed<ValidateFeedmeResult>(() => {
|
|
|
77
88
|
const restaurant = currentRestaurant
|
|
78
89
|
const profile = currentRestaurant.value?.profile
|
|
79
90
|
const formattedAddress = formatAddress(profile?.address)
|
|
80
|
-
if (!restaurant || !profile) return { message: '
|
|
91
|
+
if (!restaurant || !profile) return { message: t('order.invalidRestaurant') }
|
|
81
92
|
const phoneNo = parsePhoneNumberFromString(profile.phoneNo)
|
|
82
93
|
if (!phoneNo || !formattedAddress.isValid || !formattedAddress.isValidCoordinate) {
|
|
83
|
-
const requiredField = !phoneNo ? 'contact' : 'address'
|
|
94
|
+
const requiredField = !phoneNo ? t('order.contact') : t('order.address')
|
|
84
95
|
return {
|
|
85
|
-
message
|
|
96
|
+
message:`${t('order.invalidRestaurant')} ${requiredField}, ${t('order.pleaseCompleteProfile')}`,
|
|
97
|
+
action: {
|
|
98
|
+
label: t('order.updateNow'),
|
|
99
|
+
callback: () => {
|
|
100
|
+
router.push({ name: "$settings-my-business"})
|
|
101
|
+
}
|
|
102
|
+
}
|
|
86
103
|
}
|
|
87
104
|
}
|
|
88
105
|
|
|
@@ -149,24 +166,24 @@ import { formatAddress } from '@/helpers/profile'
|
|
|
149
166
|
|
|
150
167
|
<template>
|
|
151
168
|
<template v-if="validation === true">
|
|
152
|
-
<FmSwitch :model-value="data.enable" label="
|
|
153
|
-
sublabel="
|
|
169
|
+
<FmSwitch :model-value="data.enable" :label="`${t('order.actiavteFeedmeExpress')}`" label-placement="right"
|
|
170
|
+
:sublabel="t('order.activateFeedmeExpressSublabel')" @update:model-value="updateEnable" />
|
|
154
171
|
<div v-if="data.enable">
|
|
155
172
|
<FmCard variant="outlined" class="p-5 mt-10">
|
|
156
|
-
<div class="flex-grow fm-typo-en-title-sm-600 mb-3">
|
|
173
|
+
<div class="flex-grow fm-typo-en-title-sm-600 mb-3">{{ t('order.generalInfo') }}</div>
|
|
157
174
|
|
|
158
|
-
<FmSwitch :model-value="data.ignoreStock || false" value="ignoreStock" label="
|
|
159
|
-
sublabel="
|
|
175
|
+
<FmSwitch :model-value="data.ignoreStock || false" value="ignoreStock" :label="t('order.ignoreStock')"
|
|
176
|
+
:sublabel="t('order.ignoreStockSublabel')" label-placement="right"
|
|
160
177
|
@update:model-value="updateIgnoreStock" />
|
|
161
178
|
|
|
162
179
|
<div class="mt-5 mb-3">
|
|
163
|
-
<FmSelect :model-value="data.catalogId" label="
|
|
180
|
+
<FmSelect :model-value="data.catalogId" :label="t('order.catalog')" :items="menuStore.catalogOptions"
|
|
164
181
|
@update:model-value="updateCatalogId" />
|
|
165
182
|
</div>
|
|
166
|
-
<FmTextarea :model-value="data.term ?? undefined" label="
|
|
183
|
+
<FmTextarea :model-value="data.term ?? undefined" :label="t('order.term')" @update:model-value="updateTerm" />
|
|
167
184
|
|
|
168
185
|
<div class="mt-5 mb-3">
|
|
169
|
-
<FmTextarea :model-value="data.instruction ?? undefined" label="
|
|
186
|
+
<FmTextarea :model-value="data.instruction ?? undefined" :label="t('order.deliveryInstruction')"
|
|
170
187
|
@update:model-value="updateInstruction" />
|
|
171
188
|
</div>
|
|
172
189
|
</FmCard>
|
|
@@ -177,6 +194,12 @@ import { formatAddress } from '@/helpers/profile'
|
|
|
177
194
|
<img :src="svgPath" alt="" />
|
|
178
195
|
<div class="flex flex-col">
|
|
179
196
|
<div class="text-center mb-5">{{ validation.message }}</div>
|
|
197
|
+
<FmButton
|
|
198
|
+
v-if="validation.action"
|
|
199
|
+
variant="primary"
|
|
200
|
+
:label="validation.action.label"
|
|
201
|
+
@click = "(validation as ValidateFeedmeErrorResult).action!.callback"
|
|
202
|
+
/>
|
|
180
203
|
</div>
|
|
181
204
|
</div>
|
|
182
205
|
</div>
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
import { clone } from '@/helpers/object';
|
|
3
3
|
import Day from 'dayjs';
|
|
4
4
|
import { reactive, type PropType, watch } from 'vue';
|
|
5
|
+
import { useI18n } from '@feedmepos/mf-common'
|
|
6
|
+
|
|
7
|
+
const { t } = useI18n()
|
|
5
8
|
|
|
6
9
|
export interface IFPDiscountCampaign {
|
|
7
10
|
name: string;
|
|
@@ -87,16 +90,16 @@ function convertToDateRange(newDateRange: { start: string, end: string }): { sta
|
|
|
87
90
|
<template>
|
|
88
91
|
<FmTextField
|
|
89
92
|
v-model="data.name"
|
|
90
|
-
label="
|
|
91
|
-
placeholder="
|
|
93
|
+
:label="t('order.name')"
|
|
94
|
+
:placeholder="t('order.enterName')"
|
|
92
95
|
/>
|
|
93
96
|
|
|
94
97
|
<FmStepperField
|
|
95
98
|
class="mt-5"
|
|
96
99
|
append-text="%"
|
|
97
100
|
v-model="data.vendorBearPercentage"
|
|
98
|
-
label="
|
|
99
|
-
placeholder="
|
|
101
|
+
:label="t('order.vendorBearPercentage')"
|
|
102
|
+
:placeholder="t('order.enterANumber')"
|
|
100
103
|
:show-steppers="false"
|
|
101
104
|
/>
|
|
102
105
|
|
|
@@ -13,6 +13,9 @@ import { remoteOrderApi } from '@/api/remoteOrder'
|
|
|
13
13
|
import { useDialog } from '@feedmepos/ui-library'
|
|
14
14
|
import FoodpandaCampaignDialog, { type IFPDiscountCampaign } from './FoodpandaCampaignDialog.vue'
|
|
15
15
|
import { DateRange } from '@/helpers/date'
|
|
16
|
+
import { useI18n } from '@feedmepos/mf-common'
|
|
17
|
+
|
|
18
|
+
const { t } = useI18n()
|
|
16
19
|
|
|
17
20
|
export interface FoodpandaDeliveryData {
|
|
18
21
|
manual: FdoLinkedDelivery | null
|
|
@@ -102,7 +105,7 @@ function addCampaign() {
|
|
|
102
105
|
let updatedCampaign: IFPDiscountCampaign
|
|
103
106
|
|
|
104
107
|
Dialog.open({
|
|
105
|
-
title: '
|
|
108
|
+
title: t('order.addCampaign'),
|
|
106
109
|
contentComponent: FoodpandaCampaignDialog,
|
|
107
110
|
contentComponentProps: {
|
|
108
111
|
'onUpdate:modelValue': (v: IFPDiscountCampaign) => {
|
|
@@ -110,7 +113,7 @@ function addCampaign() {
|
|
|
110
113
|
}
|
|
111
114
|
},
|
|
112
115
|
primaryActions: {
|
|
113
|
-
text: '
|
|
116
|
+
text: t('order.add'),
|
|
114
117
|
variant: 'primary',
|
|
115
118
|
close: true
|
|
116
119
|
}
|
|
@@ -223,8 +226,8 @@ async function cancelTestOrder() {
|
|
|
223
226
|
:can-use-auto-delivery-integration="canUseAutoDeliveryIntegration" @update:model-value="updateDataPass"
|
|
224
227
|
@sync-menu="syncMenu" @flow-test-order="flowTestOrder" @cancel-test-order="cancelTestOrder">
|
|
225
228
|
<template #default="{ editable }">
|
|
226
|
-
<div class="flex-grow fm-typo-en-title-sm-600 mb-3 mt-10">
|
|
227
|
-
<FmButton label="
|
|
229
|
+
<div class="flex-grow fm-typo-en-title-sm-600 mb-3 mt-10">{{ t('order.discountCampaign')}}</div>
|
|
230
|
+
<FmButton :label="t('order.addNewCampaign')" icon="add" variant="plain" @click="addCampaign" class="mb-3" />
|
|
228
231
|
|
|
229
232
|
<div v-if="campaigns.length > 0">
|
|
230
233
|
<div v-for="(campaign, index) in campaigns" :key="index">
|