@feedmepos/mf-order-setting 0.0.14-alpha → 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-CbKAPxxI.js → app-vuQcAuTZ.js} +9 -14
- package/dist/app.js +1 -1
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/views/order-settings/servicecharge/ServiceChargeSetting.vue +23 -73
- package/dist/KioskSettingView-DNN7VBM4.js +0 -4
package/package.json
CHANGED
|
@@ -5,40 +5,22 @@
|
|
|
5
5
|
<div v-if="!isLoading">
|
|
6
6
|
<div class="p-[1.5rem] flex flex-col gap-5">
|
|
7
7
|
<FmCard variant="outlined" class="p-5 sm:w-2/3 md:w-2/3 lg:w-1/3 xl:w-1/3">
|
|
8
|
-
<div class="flex-grow fm-typo-en-title-sm-600 mb-3">
|
|
9
|
-
|
|
10
|
-
</div>
|
|
11
|
-
<FmSwitch
|
|
12
|
-
v-model="data.active"
|
|
13
|
-
value="first"
|
|
8
|
+
<div class="flex-grow fm-typo-en-title-sm-600 mb-3">{{ t('order.enableServiceCharge') }}</div>
|
|
9
|
+
<FmSwitch v-model="data.active" value="first"
|
|
14
10
|
:sublabel="t('order.serviceChargeSublabel')"
|
|
15
|
-
:label="t('order.serviceCharge')"
|
|
16
|
-
|
|
17
|
-
:disabled="!canUseServiceCharge"
|
|
18
|
-
/>
|
|
19
|
-
<div
|
|
20
|
-
v-if="!canUseServiceCharge"
|
|
21
|
-
class="fm-typo-en-body-md-400 text-fm-color-typo-error ml-14"
|
|
22
|
-
>
|
|
11
|
+
:label="t('order.serviceCharge')" label-placement="right" :disabled="!canUseServiceCharge" />
|
|
12
|
+
<div v-if="!canUseServiceCharge" class="fm-typo-en-body-md-400 text-fm-color-typo-error ml-14">
|
|
23
13
|
{{ t('order.serviceChargeRule') }}
|
|
24
14
|
</div>
|
|
25
15
|
|
|
26
16
|
<div class="flex flex-col gap-5 m-5" v-if="data.active">
|
|
27
|
-
<FmRadioGroup
|
|
28
|
-
:model-value="chargeTime"
|
|
29
|
-
:label="t('order.chargeWhen')"
|
|
30
|
-
@update:model-value="updateChargeWhen"
|
|
31
|
-
>
|
|
17
|
+
<FmRadioGroup :model-value="chargeTime" :label="t('order.chargeWhen')" @update:model-value="updateChargeWhen">
|
|
32
18
|
<FmRadio value="beforeDiscount" :label="t('order.beforeBillDiscount')" />
|
|
33
19
|
<FmRadio value="afterDiscount" :label="t('order.afterBillDiscount')" />
|
|
34
20
|
</FmRadioGroup>
|
|
35
21
|
<RateInput :model-value="data.rate" @update:model-value="handleUpdateRate" />
|
|
36
22
|
|
|
37
|
-
<FmRadioGroup
|
|
38
|
-
:model-value="chargeValue"
|
|
39
|
-
:label="t('order.selectServiceChargeType')"
|
|
40
|
-
@update:model-value="updateInclusive"
|
|
41
|
-
>
|
|
23
|
+
<FmRadioGroup :model-value="chargeValue" :label="t('order.selectServiceChargeType')" @update:model-value="updateInclusive">
|
|
42
24
|
<FmRadio value="exclusive" :label="t('order.exclusive')" />
|
|
43
25
|
<FmRadio value="inclusive" :label="t('order.inclusive')" />
|
|
44
26
|
</FmRadioGroup>
|
|
@@ -47,40 +29,24 @@
|
|
|
47
29
|
</div>
|
|
48
30
|
<div v-if="data.active">
|
|
49
31
|
<div class="flex flex-col gap-5 m-5">
|
|
50
|
-
<div class="flex-grow fm-typo-en-title-sm-600 mb-3 mt-3">
|
|
51
|
-
{{ t('order.customServiceCharge') }}
|
|
52
|
-
</div>
|
|
32
|
+
<div class="flex-grow fm-typo-en-title-sm-600 mb-3 mt-3">{{ t('order.customServiceCharge') }}</div>
|
|
53
33
|
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-5">
|
|
54
34
|
<div v-for="(rule, index) in data.rules" :key="index" class="h-full">
|
|
55
35
|
<FmCard variant="outlined">
|
|
56
36
|
<FmCardSection>
|
|
57
|
-
<ServiceChargeRule
|
|
58
|
-
:
|
|
59
|
-
:
|
|
60
|
-
:
|
|
61
|
-
:
|
|
62
|
-
:tables="tableSettingStore.tables"
|
|
63
|
-
:is-loading-menu="isLoadingMenu"
|
|
64
|
-
:is-loading-table="isLoadingTables"
|
|
65
|
-
@delete="deleteRule(index)"
|
|
66
|
-
@update:model-value="(v: FdoServiceChargeRule) => updateRule(index, v)"
|
|
67
|
-
/>
|
|
37
|
+
<ServiceChargeRule :model-value="rule" :inclusive="data.inclusive"
|
|
38
|
+
:charge-before-discount="isBeforeDiscountBoolean" :items="menuStore.categorizedItems"
|
|
39
|
+
:tables="tableSettingStore.tables" :is-loading-menu="isLoadingMenu"
|
|
40
|
+
:is-loading-table="isLoadingTables" @delete="deleteRule(index)"
|
|
41
|
+
@update:model-value="(v: FdoServiceChargeRule) => updateRule(index, v)" />
|
|
68
42
|
</FmCardSection>
|
|
69
43
|
</FmCard>
|
|
70
44
|
</div>
|
|
71
45
|
<div>
|
|
72
|
-
<FmCard
|
|
73
|
-
variant="outlined"
|
|
74
|
-
class="flex items-center justify-center w-full h-full border-dashed"
|
|
75
|
-
>
|
|
46
|
+
<FmCard variant="outlined" class="flex items-center justify-center w-full h-full border-dashed">
|
|
76
47
|
<FmCardSection class="flex items-center justify-center w-full">
|
|
77
|
-
<FmButton
|
|
78
|
-
|
|
79
|
-
:label="t('order.addServiceCharge')"
|
|
80
|
-
icon="add"
|
|
81
|
-
@click="createRule"
|
|
82
|
-
class="border fm-corner-radius-lg border-fm-color-primary"
|
|
83
|
-
/>
|
|
48
|
+
<FmButton variant="plain" :label="t('order.addServiceCharge')" icon="add" @click="createRule"
|
|
49
|
+
class="border fm-corner-radius-lg border-fm-color-primary" />
|
|
84
50
|
</FmCardSection>
|
|
85
51
|
</FmCard>
|
|
86
52
|
</div>
|
|
@@ -88,12 +54,7 @@
|
|
|
88
54
|
</div>
|
|
89
55
|
</div>
|
|
90
56
|
<div class="fm-corner-radius-lg flex flex-col gap-5 m-5">
|
|
91
|
-
<FmButton
|
|
92
|
-
variant="primary"
|
|
93
|
-
:label="t('order.saveSetting')"
|
|
94
|
-
class="mr-auto"
|
|
95
|
-
@click="updateServiceChargeSetting"
|
|
96
|
-
/>
|
|
57
|
+
<FmButton variant="primary" :label="t('order.saveSetting')" class="mr-auto" @click="updateServiceChargeSetting" />
|
|
97
58
|
</div>
|
|
98
59
|
</div>
|
|
99
60
|
<FmCircularProgress size="xxl" v-else />
|
|
@@ -184,19 +145,11 @@ function updateInclusive(inclusiveValue: string) {
|
|
|
184
145
|
}
|
|
185
146
|
|
|
186
147
|
function createRule() {
|
|
187
|
-
data.value.rules
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
condition: {}
|
|
193
|
-
}
|
|
194
|
-
]
|
|
195
|
-
// data.value.rules.push({
|
|
196
|
-
// rate: data.value.rate,
|
|
197
|
-
// inclusive: data.value.inclusive,
|
|
198
|
-
// condition: {}
|
|
199
|
-
// })
|
|
148
|
+
data.value.rules.push({
|
|
149
|
+
rate: data.value.rate,
|
|
150
|
+
inclusive: data.value.inclusive,
|
|
151
|
+
condition: {}
|
|
152
|
+
})
|
|
200
153
|
}
|
|
201
154
|
|
|
202
155
|
function updateRule(index: number, rule: FdoServiceChargeRule) {
|
|
@@ -204,8 +157,7 @@ function updateRule(index: number, rule: FdoServiceChargeRule) {
|
|
|
204
157
|
}
|
|
205
158
|
|
|
206
159
|
function deleteRule(index: number) {
|
|
207
|
-
data.value.rules
|
|
208
|
-
// data.value.rules.splice(index, 1)
|
|
160
|
+
data.value.rules.splice(index, 1)
|
|
209
161
|
}
|
|
210
162
|
|
|
211
163
|
import { useSnackbarFunctions } from '@/components/snackbar'
|
|
@@ -218,9 +170,7 @@ async function updateServiceChargeSetting() {
|
|
|
218
170
|
await restaurantStore.updateServiceCharge(data.value)
|
|
219
171
|
showSuccess('Service charge setting updated. ')
|
|
220
172
|
})
|
|
221
|
-
const restaurantSetting = await restaurantStore.readRestaurantSetting(
|
|
222
|
-
currentRestaurant.value?._id || ''
|
|
223
|
-
)
|
|
173
|
+
const restaurantSetting = await restaurantStore.readRestaurantSetting(currentRestaurant.value?._id || '')
|
|
224
174
|
initialize(restaurantSetting)
|
|
225
175
|
}
|
|
226
176
|
|