@feedmepos/mf-order-setting 0.0.43 → 0.0.44
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/{OrderSettingsView-CoAGawQi.js → OrderSettingsView-CEh1QUZm.js} +2999 -2998
- package/dist/{app-Db1lhCv7.js → app-CKeIud_f.js} +1 -1
- 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/delivery/DeliverySetting.vue +10 -5
- package/src/views/order-settings/delivery/components/ManualIntegratedDeliverySetting.vue +9 -7
package/package.json
CHANGED
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
:model-value="localDoc"
|
|
143
143
|
:company="selectedLocalRow.doc"
|
|
144
144
|
:catalog-options="menuStore.catalogOptions"
|
|
145
|
-
@update:model-value="
|
|
145
|
+
@update:model-value="handleLocalDocUpdate"
|
|
146
146
|
/>
|
|
147
147
|
<template #side-sheet-footer>
|
|
148
148
|
<div class="flex gap-8 items-center justify-start">
|
|
@@ -240,14 +240,13 @@ const sideSheet = ref<boolean>(false)
|
|
|
240
240
|
const loading = computed(() => {
|
|
241
241
|
return !currentRestaurant.value || loadingDpi.value
|
|
242
242
|
})
|
|
243
|
-
let localDoc: FdoLinkedDelivery | null
|
|
244
|
-
let localDocUpdate: FdoLinkedDelivery | null
|
|
245
243
|
const selectedIntegratedRow = ref<any>(null)
|
|
246
244
|
const sideSheetIntegrated = ref<boolean>(false)
|
|
247
245
|
const selectedLocalRow = ref<any>(null)
|
|
248
246
|
async function toggleLocalSidesheet(rowData: any) {
|
|
249
247
|
selectedLocalRow.value = rowData.original ?? rowData
|
|
250
|
-
localDoc = getLinkedDeliveryDoc(linkedCompanies.value, selectedLocalRow.value.key) ?? null
|
|
248
|
+
localDoc.value = getLinkedDeliveryDoc(linkedCompanies.value, selectedLocalRow.value.key) ?? null
|
|
249
|
+
localDocUpdate.value = localDoc.value
|
|
251
250
|
sideSheet.value = true
|
|
252
251
|
}
|
|
253
252
|
|
|
@@ -458,6 +457,8 @@ const getClassForStatus = (enabled: StatusType): string => {
|
|
|
458
457
|
}
|
|
459
458
|
|
|
460
459
|
const model = ref()
|
|
460
|
+
const localDoc = ref<FdoLinkedDelivery | null>(null)
|
|
461
|
+
const localDocUpdate = ref<FdoLinkedDelivery | null>(null)
|
|
461
462
|
|
|
462
463
|
const capitalizeFirstLetter = (str: string) => str.charAt(0).toUpperCase() + str.slice(1)
|
|
463
464
|
|
|
@@ -767,7 +768,7 @@ async function updateLocalDeliveryCompany() {
|
|
|
767
768
|
await updateManualDelivery({
|
|
768
769
|
doc: linkedDoc,
|
|
769
770
|
company: selectedLocalRow.value.doc,
|
|
770
|
-
data: localDocUpdate
|
|
771
|
+
data: localDocUpdate.value
|
|
771
772
|
})
|
|
772
773
|
showSuccess(t('order.DeliverySettingUpdated'))
|
|
773
774
|
}
|
|
@@ -834,6 +835,10 @@ function deleteCached(doc: LinkedDeliveryDoc) {
|
|
|
834
835
|
linkedCompanies.value = remove(linkedCompanies.value, doc, 'key')
|
|
835
836
|
}
|
|
836
837
|
|
|
838
|
+
function handleLocalDocUpdate(v: FdoLinkedDelivery | null) {
|
|
839
|
+
localDocUpdate.value = v
|
|
840
|
+
}
|
|
841
|
+
|
|
837
842
|
function closeLocalDeliverySideSheet() {
|
|
838
843
|
sideSheet.value = false
|
|
839
844
|
}
|
|
@@ -33,11 +33,11 @@ const emits = defineEmits<{
|
|
|
33
33
|
const data = ref<LocalDeliverySettingData>(
|
|
34
34
|
props.modelValue
|
|
35
35
|
? {
|
|
36
|
+
...props.modelValue,
|
|
36
37
|
active: !!props.modelValue,
|
|
37
|
-
catalogId: null,
|
|
38
|
+
catalogId: props.modelValue.catalogId ?? null,
|
|
38
39
|
rounding: props.modelValue.rounding ?? true,
|
|
39
|
-
requiredRemark: props.modelValue.requiredRemark ?? false
|
|
40
|
-
...props.modelValue
|
|
40
|
+
requiredRemark: props.modelValue.requiredRemark ?? false
|
|
41
41
|
}
|
|
42
42
|
: {
|
|
43
43
|
...props.company,
|
|
@@ -52,12 +52,13 @@ watch(
|
|
|
52
52
|
() => props.modelValue,
|
|
53
53
|
(newVal) => {
|
|
54
54
|
if (newVal) {
|
|
55
|
+
// Create a clean copy to prevent reference sharing
|
|
55
56
|
data.value = {
|
|
57
|
+
...newVal,
|
|
56
58
|
active: !!newVal,
|
|
57
|
-
catalogId: null,
|
|
59
|
+
catalogId: newVal.catalogId ?? null,
|
|
58
60
|
rounding: newVal.rounding ?? true,
|
|
59
|
-
requiredRemark: newVal.requiredRemark ?? false
|
|
60
|
-
...newVal
|
|
61
|
+
requiredRemark: newVal.requiredRemark ?? false
|
|
61
62
|
}
|
|
62
63
|
} else {
|
|
63
64
|
data.value = {
|
|
@@ -87,7 +88,8 @@ const paymentTypeOptions = computed(() => {
|
|
|
87
88
|
function emitChange(fn: (oldV: LocalDeliverySettingData) => LocalDeliverySettingData) {
|
|
88
89
|
const newV = fn({ ...data.value })
|
|
89
90
|
data.value = newV
|
|
90
|
-
|
|
91
|
+
// Emit a clean copy to prevent reference sharing between component instances
|
|
92
|
+
emits('update:model-value', newV.active ? { ...newV } : null)
|
|
91
93
|
}
|
|
92
94
|
|
|
93
95
|
function updateActive(active: boolean) {
|