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 () => { }); - + {{ t('globals.changesToSave') }} diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index f24eb3457..d545f13be 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -453,6 +453,7 @@ export default { list: { parking: 'Parking', priority: 'Priority', + newShelving: 'New Shelving' }, summary: { code: 'Code', diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 5e1b999ac..93e3cf411 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -455,6 +455,7 @@ export default { list: { parking: 'Parking', priority: 'Prioridad', + newShelving: 'Nuevo Carro' }, summary: { code: 'Código', diff --git a/src/pages/Shelving/Card/ShelvingCard.vue b/src/pages/Shelving/Card/ShelvingCard.vue index f16e0a718..221740486 100644 --- a/src/pages/Shelving/Card/ShelvingCard.vue +++ b/src/pages/Shelving/Card/ShelvingCard.vue @@ -15,14 +15,7 @@ const stateStore = useStateStore(); - - - - - - - - + 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 @@ + + + + + - - - - - - props.filter(value, update, parkingSelectFilter) - " - :rules="props.validate('Shelving.parkingFk')" - :input-debounce="0" - /> - - - - - - - - - - + + + + + + + + filter(value, update, parkingSelectFilter) + " + :rules="validate('Shelving.parkingFk')" + :input-debounce="0" + /> + + + + + + + + + + + + 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 @@ - - - - - - {{ t('globals.collapseMenu') }} - - - - - - - - {{ entity.code }} - - - - - {{ t('shelving.pageTitles.basicData') }} - - - - - - - - - - + + + + + + {{ t('globals.collapseMenu') }} + + + + + + + + + {{ entity.code }} + + + + + {{ t('shelving.pageTitles.basicData') }} + + + + + + + + + + + -import { useRoute } from 'vue-router'; -import FormModel from 'components/FormModel.vue'; -import ShelvingForm from "pages/Shelving/Card/ShelvingForm.vue"; - -const route = useRoute(); - -const shelvingId = route.params?.id || null; - -const shelvingFilter = { - include: [ - { - relation: 'worker', - scope: { - fields: ['id'], - include: { - relation: 'user', - scope: { fields: ['nickname'] }, - }, - }, - }, - { relation: 'parking' }, - ], -}; - - - - - - - - diff --git a/src/pages/Shelving/ShelvingCreate.vue b/src/pages/Shelving/ShelvingCreate.vue deleted file mode 100644 index df9edf774..000000000 --- a/src/pages/Shelving/ShelvingCreate.vue +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - diff --git a/src/pages/Shelving/ShelvingList.vue b/src/pages/Shelving/ShelvingList.vue index 597288ac7..8b31e90cd 100644 --- a/src/pages/Shelving/ShelvingList.vue +++ b/src/pages/Shelving/ShelvingList.vue @@ -123,7 +123,7 @@ function exprBuilder(param, value) { - {{ t('supplier.list.newSupplier') }} + {{ t('shelving.list.newShelving') }} diff --git a/src/router/modules/shelving.js b/src/router/modules/shelving.js index 7b28e15d1..494f286c3 100644 --- a/src/router/modules/shelving.js +++ b/src/router/modules/shelving.js @@ -35,7 +35,7 @@ export default { meta: { title: 'create', }, - component: () => import('src/pages/Shelving/ShelvingCreate.vue'), + component: () => import('src/pages/Shelving/Card/ShelvingForm.vue'), }, ], }, @@ -62,7 +62,7 @@ export default { icon: 'vn:settings', roles: ['salesPerson'], }, - component: () => import('pages/Shelving/ShelvingBasicData.vue'), + component: () => import('pages/Shelving/Card/ShelvingForm.vue'), }, { name: 'ShelvingLog',