diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 986358930..453b3ffe1 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -84,7 +84,7 @@ onUnmounted(() => { const isLoading = ref(false); // Si elegimos observar los cambios del form significa que inicialmente las actions estaran deshabilitadas const hasChanges = ref(!$props.observeFormChanges); -const originalData = ref(); +const originalData = ref({...$props.formInitialData}); const formData = computed(() => state.get($props.model)); const formUrl = computed(() => $props.url); @@ -141,7 +141,9 @@ function reset() { originalData.value = JSON.parse(JSON.stringify(originalData.value)); emit('onFetch', state.get($props.model)); - hasChanges.value = false; + if ($props.observeFormChanges) { + hasChanges.value = false; + } } // eslint-disable-next-line vue/no-dupe-keys @@ -166,7 +168,7 @@ watch(formUrl, async () => { }); diff --git a/src/pages/Shelving/Card/ShelvingForm.vue b/src/pages/Shelving/Card/ShelvingForm.vue index d919a05ba..e30ac1939 100644 --- a/src/pages/Shelving/Card/ShelvingForm.vue +++ b/src/pages/Shelving/Card/ShelvingForm.vue @@ -1,30 +1,23 @@ diff --git a/src/pages/Shelving/Card/ShelvingSummary.vue b/src/pages/Shelving/Card/ShelvingSummary.vue index 492c9bba2..f1f914385 100644 --- a/src/pages/Shelving/Card/ShelvingSummary.vue +++ b/src/pages/Shelving/Card/ShelvingSummary.vue @@ -1,11 +1,11 @@