@feedmepos/mf-order-setting 0.0.19 → 0.0.20
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-BoHtjiKm.js → KioskDevicesView-BnU_Z30B.js} +1 -1
- package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-CEEmPqnA.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-2dGio8Lw.js} +1 -1
- package/dist/{KioskView-CBCeIzVp.js → KioskView-DqV4IW7U.js} +3 -3
- package/dist/{OrderSettingsView-BvuzzvCp.js → OrderSettingsView-CIUddOED.js} +1552 -1558
- package/dist/{app-CbCRr7mV.js → app-CuyLbKuN.js} +3 -3
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-WEimBwWx.js → dayjs.min-BJrst4DM.js} +1 -1
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{index-SQG-c9lu.js → index-DPl0R4fg.js} +1 -1
- package/package.json +1 -1
- package/src/views/order-settings/pickup/PickUpSetting.vue +14 -14
- package/tsconfig.json +0 -8
package/package.json
CHANGED
|
@@ -28,15 +28,18 @@
|
|
|
28
28
|
<script setup lang="ts">
|
|
29
29
|
import { computed, h, onMounted, ref, watch } from 'vue'
|
|
30
30
|
import type { ColumnDef } from '@feedmepos/ui-library'
|
|
31
|
-
import { useCoreStore } from '@feedmepos/mf-common'
|
|
32
|
-
import type {
|
|
31
|
+
import { useCoreStore, useI18n } from '@feedmepos/mf-common'
|
|
32
|
+
import type { FdoRestaurant, FdoRestaurantPickup } from '@feedmepos/core/entity'
|
|
33
33
|
import { useRestaurantStore } from '@/stores/restaurant'
|
|
34
34
|
import useSearch from '@/composables/search'
|
|
35
35
|
import { sentenceCase } from 'change-case'
|
|
36
36
|
import PickUpSettingDialog from './PickUpSettingDialog.vue'
|
|
37
37
|
import { useLoading } from '@/composables/loading'
|
|
38
38
|
import PickupList from './PickupList.vue'
|
|
39
|
-
|
|
39
|
+
|
|
40
|
+
interface FmpRestaurant extends FdoRestaurant {
|
|
41
|
+
managable: boolean
|
|
42
|
+
}
|
|
40
43
|
|
|
41
44
|
const { t } = useI18n()
|
|
42
45
|
const { searchKey, filter } = useSearch()
|
|
@@ -44,9 +47,10 @@ const { restaurants, changeRestaurant, currentRestaurant } = useCoreStore()
|
|
|
44
47
|
const restaurantStore = useRestaurantStore()
|
|
45
48
|
const sideSheet = ref<boolean>(false)
|
|
46
49
|
const { isLoading, startAsyncCallWithErr } = useLoading()
|
|
50
|
+
const currentRestaurants = ref<FmpRestaurant[]>([])
|
|
47
51
|
|
|
48
52
|
const pickupSetting = computed<RestaurantPickup[]>(() => {
|
|
49
|
-
return
|
|
53
|
+
return currentRestaurants.value.map((r: FmpRestaurant) => {
|
|
50
54
|
const restaurantSetting = restaurantStore.restaurantSettings[r._id]
|
|
51
55
|
|
|
52
56
|
return {
|
|
@@ -62,8 +66,11 @@ const pickupSetting = computed<RestaurantPickup[]>(() => {
|
|
|
62
66
|
|
|
63
67
|
async function fetchRestaurants() {
|
|
64
68
|
await startAsyncCallWithErr(async () => {
|
|
69
|
+
if (!!restaurants.value) {
|
|
70
|
+
currentRestaurants.value = [...restaurants.value]
|
|
71
|
+
}
|
|
65
72
|
await Promise.all(
|
|
66
|
-
|
|
73
|
+
currentRestaurants.value.map(async (r: FmpRestaurant) => {
|
|
67
74
|
await restaurantStore.readRestaurantSetting(r._id)
|
|
68
75
|
})
|
|
69
76
|
)
|
|
@@ -82,14 +89,7 @@ watch(
|
|
|
82
89
|
)
|
|
83
90
|
|
|
84
91
|
async function onUpdate() {
|
|
85
|
-
await
|
|
86
|
-
await Promise.all(
|
|
87
|
-
restaurants.value.map(async (r) => {
|
|
88
|
-
await changeRestaurant(r)
|
|
89
|
-
await restaurantStore.readRestaurantSetting(r._id)
|
|
90
|
-
})
|
|
91
|
-
)
|
|
92
|
-
})
|
|
92
|
+
await fetchRestaurants()
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
let originalRestaurant: any
|
|
@@ -98,7 +98,7 @@ async function toggleSideSheet(rowData: any) {
|
|
|
98
98
|
const v = rowData?.original?.restaurantId ?? rowData?.restaurantId
|
|
99
99
|
originalRestaurant = currentRestaurant.value
|
|
100
100
|
|
|
101
|
-
const restaurant =
|
|
101
|
+
const restaurant = currentRestaurants.value.find((r: FmpRestaurant) => r._id === v)
|
|
102
102
|
if (restaurant) {
|
|
103
103
|
await changeRestaurant(restaurant)
|
|
104
104
|
}
|