@feedmepos/mf-order-setting 0.0.19-alpha.2 → 0.0.19
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-BfAQCs__.js → KioskDevicesView-BoHtjiKm.js} +1 -1
- package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-DoF-AXaT.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-CEEmPqnA.js} +1 -1
- package/dist/{KioskView-C5ClqhNb.js → KioskView-CBCeIzVp.js} +3 -3
- package/dist/{OrderSettingsView-CVsgcCZv.js → OrderSettingsView-BvuzzvCp.js} +1559 -1553
- package/dist/{app-C3PQ9r3w.js → app-CbCRr7mV.js} +3 -3
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-Sszw1zIA.js → dayjs.min-WEimBwWx.js} +1 -1
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{index-Bh8lg9Uc.js → index-SQG-c9lu.js} +1 -1
- package/package.json +1 -1
- package/src/views/order-settings/pickup/PickUpSetting.vue +14 -18
package/package.json
CHANGED
|
@@ -28,14 +28,15 @@
|
|
|
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
|
|
32
|
-
import type { FdoRestaurantPickup } from '@feedmepos/core/entity'
|
|
31
|
+
import { useCoreStore } from '@feedmepos/mf-common'
|
|
32
|
+
import type { FdoPickupPoint, 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'
|
|
39
40
|
|
|
40
41
|
const { t } = useI18n()
|
|
41
42
|
const { searchKey, filter } = useSearch()
|
|
@@ -43,12 +44,9 @@ const { restaurants, changeRestaurant, currentRestaurant } = useCoreStore()
|
|
|
43
44
|
const restaurantStore = useRestaurantStore()
|
|
44
45
|
const sideSheet = ref<boolean>(false)
|
|
45
46
|
const { isLoading, startAsyncCallWithErr } = useLoading()
|
|
46
|
-
const currentRestaurants = ref<any[]>([])
|
|
47
47
|
|
|
48
48
|
const pickupSetting = computed<RestaurantPickup[]>(() => {
|
|
49
|
-
|
|
50
|
-
console.log(`computed - !!${currentRestaurant.value}`)
|
|
51
|
-
return currentRestaurants.value.map((r: any) => {
|
|
49
|
+
return restaurants.value.map((r) => {
|
|
52
50
|
const restaurantSetting = restaurantStore.restaurantSettings[r._id]
|
|
53
51
|
|
|
54
52
|
return {
|
|
@@ -64,15 +62,8 @@ const pickupSetting = computed<RestaurantPickup[]>(() => {
|
|
|
64
62
|
|
|
65
63
|
async function fetchRestaurants() {
|
|
66
64
|
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
|
-
|
|
74
65
|
await Promise.all(
|
|
75
|
-
|
|
66
|
+
restaurants.value.map(async (r) => {
|
|
76
67
|
await restaurantStore.readRestaurantSetting(r._id)
|
|
77
68
|
})
|
|
78
69
|
)
|
|
@@ -80,20 +71,25 @@ async function fetchRestaurants() {
|
|
|
80
71
|
}
|
|
81
72
|
|
|
82
73
|
onMounted(async () => {
|
|
83
|
-
console.log('onMounted')
|
|
84
74
|
await fetchRestaurants()
|
|
85
75
|
})
|
|
86
76
|
|
|
87
77
|
watch(
|
|
88
78
|
() => restaurants.value,
|
|
89
79
|
async () => {
|
|
90
|
-
console.log('watch')
|
|
91
80
|
await fetchRestaurants()
|
|
92
81
|
}
|
|
93
82
|
)
|
|
94
83
|
|
|
95
84
|
async function onUpdate() {
|
|
96
|
-
await
|
|
85
|
+
await startAsyncCallWithErr(async () => {
|
|
86
|
+
await Promise.all(
|
|
87
|
+
restaurants.value.map(async (r) => {
|
|
88
|
+
await changeRestaurant(r)
|
|
89
|
+
await restaurantStore.readRestaurantSetting(r._id)
|
|
90
|
+
})
|
|
91
|
+
)
|
|
92
|
+
})
|
|
97
93
|
}
|
|
98
94
|
|
|
99
95
|
let originalRestaurant: any
|
|
@@ -102,7 +98,7 @@ async function toggleSideSheet(rowData: any) {
|
|
|
102
98
|
const v = rowData?.original?.restaurantId ?? rowData?.restaurantId
|
|
103
99
|
originalRestaurant = currentRestaurant.value
|
|
104
100
|
|
|
105
|
-
const restaurant =
|
|
101
|
+
const restaurant = restaurants.value.find((r) => r._id === v)
|
|
106
102
|
if (restaurant) {
|
|
107
103
|
await changeRestaurant(restaurant)
|
|
108
104
|
}
|