@feedmepos/mf-order-setting 0.0.18 → 0.0.19-alpha.1
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-CuHZd6_9.js → KioskDevicesView-BAA8mRWa.js} +1 -1
- package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-5mr80TnE.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-DEsWXvg_.js} +1 -1
- package/dist/{KioskView-Dy1o-gJs.js → KioskView-Nc1_y9Ub.js} +3 -3
- package/dist/{OrderSettingsView-B-uga-ib.js → OrderSettingsView-BHK4JLEY.js} +2292 -2290
- package/dist/{app-DOZsphNG.js → app-Doymjydv.js} +3 -3
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-7bYz19Mt.js → dayjs.min-BRln33N4.js} +1 -1
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{index-B0G4vTU2.js → index-C11cYT__.js} +1 -1
- package/package.json +1 -1
- package/src/views/order-settings/pickup/PickUpSetting.vue +30 -15
package/package.json
CHANGED
|
@@ -28,15 +28,14 @@
|
|
|
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 { 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
|
-
import { useI18n } from '@feedmepos/mf-common'
|
|
40
39
|
|
|
41
40
|
const { t } = useI18n()
|
|
42
41
|
const { searchKey, filter } = useSearch()
|
|
@@ -44,9 +43,12 @@ const { restaurants, changeRestaurant, currentRestaurant } = useCoreStore()
|
|
|
44
43
|
const restaurantStore = useRestaurantStore()
|
|
45
44
|
const sideSheet = ref<boolean>(false)
|
|
46
45
|
const { isLoading, startAsyncCallWithErr } = useLoading()
|
|
46
|
+
const currentRestaurants = ref<any[]>([])
|
|
47
47
|
|
|
48
48
|
const pickupSetting = computed<RestaurantPickup[]>(() => {
|
|
49
|
-
|
|
49
|
+
console.log('computed')
|
|
50
|
+
console.log(`computed - !!${currentRestaurant.value}`)
|
|
51
|
+
return currentRestaurants.value.map((r: any) => {
|
|
50
52
|
const restaurantSetting = restaurantStore.restaurantSettings[r._id]
|
|
51
53
|
|
|
52
54
|
return {
|
|
@@ -60,25 +62,38 @@ const pickupSetting = computed<RestaurantPickup[]>(() => {
|
|
|
60
62
|
})
|
|
61
63
|
})
|
|
62
64
|
|
|
63
|
-
|
|
65
|
+
async function fetchRestaurants() {
|
|
64
66
|
await startAsyncCallWithErr(async () => {
|
|
67
|
+
console.log(`restaurants.value - ${!!restaurants.value}`)
|
|
68
|
+
console.log(`fetchRestaurants - !!${currentRestaurant.value}`)
|
|
69
|
+
if (!!restaurants.value) {
|
|
70
|
+
currentRestaurants.value = restaurants.value
|
|
71
|
+
}
|
|
72
|
+
console.log(`fetchRestaurants - !!${currentRestaurant.value}`)
|
|
73
|
+
|
|
65
74
|
await Promise.all(
|
|
66
|
-
|
|
75
|
+
currentRestaurants.value.map(async (r: any) => {
|
|
67
76
|
await restaurantStore.readRestaurantSetting(r._id)
|
|
68
77
|
})
|
|
69
78
|
)
|
|
70
79
|
})
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
onMounted(async () => {
|
|
83
|
+
console.log('onMounted')
|
|
84
|
+
await fetchRestaurants()
|
|
71
85
|
})
|
|
72
86
|
|
|
87
|
+
watch(
|
|
88
|
+
() => restaurants.value,
|
|
89
|
+
async () => {
|
|
90
|
+
console.log('watch')
|
|
91
|
+
await fetchRestaurants()
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
|
|
73
95
|
async function onUpdate() {
|
|
74
|
-
await
|
|
75
|
-
await Promise.all(
|
|
76
|
-
restaurants.value.map(async (r) => {
|
|
77
|
-
await changeRestaurant(r)
|
|
78
|
-
await restaurantStore.readRestaurantSetting(r._id)
|
|
79
|
-
})
|
|
80
|
-
)
|
|
81
|
-
})
|
|
96
|
+
await fetchRestaurants()
|
|
82
97
|
}
|
|
83
98
|
|
|
84
99
|
let originalRestaurant: any
|
|
@@ -87,7 +102,7 @@ async function toggleSideSheet(rowData: any) {
|
|
|
87
102
|
const v = rowData?.original?.restaurantId ?? rowData?.restaurantId
|
|
88
103
|
originalRestaurant = currentRestaurant.value
|
|
89
104
|
|
|
90
|
-
const restaurant =
|
|
105
|
+
const restaurant = currentRestaurants.value.find((r: any) => r._id === v)
|
|
91
106
|
if (restaurant) {
|
|
92
107
|
await changeRestaurant(restaurant)
|
|
93
108
|
}
|