From 1ab9bfefeda7a0e50a8daa961c955a4a4090eade Mon Sep 17 00:00:00 2001 From: Kevin Martinez Date: Thu, 7 Mar 2024 20:36:56 -0300 Subject: [PATCH] Centralize roadmap add stop form --- .../Route/Roadmap/RoadmapAddStopDialog.vue | 49 +-------- .../Route/Roadmap/RoadmapAddStopForm.vue | 104 ++++++++++++++++++ src/pages/Route/Roadmap/RoadmapStops.vue | 55 ++------- 3 files changed, 117 insertions(+), 91 deletions(-) create mode 100644 src/pages/Route/Roadmap/RoadmapAddStopForm.vue diff --git a/src/pages/Route/Roadmap/RoadmapAddStopDialog.vue b/src/pages/Route/Roadmap/RoadmapAddStopDialog.vue index 659158714..810ef42c8 100644 --- a/src/pages/Route/Roadmap/RoadmapAddStopDialog.vue +++ b/src/pages/Route/Roadmap/RoadmapAddStopDialog.vue @@ -4,10 +4,7 @@ import { useI18n } from 'vue-i18n'; import { reactive, ref } from 'vue'; import axios from 'axios'; import FetchData from 'components/FetchData.vue'; -import VnSelectFilter from 'components/common/VnSelectFilter.vue'; -import VnInputTime from 'components/common/VnInputTime.vue'; -import VnInputDate from 'components/common/VnInputDate.vue'; -import VnInput from 'components/common/VnInput.vue'; +import RoadmapAddStopForm from 'pages/Route/Roadmap/RoadmapAddStopForm.vue'; const emit = defineEmits([...useDialogPluginComponent.emits]); const { dialogRef, onDialogHide } = useDialogPluginComponent(); @@ -21,7 +18,6 @@ const props = defineProps({ }); const isLoading = ref(false); -const warehouseList = ref([]); const roadmapStopForm = reactive({ roadmapFk: Number(props.roadmapFk) || 0, warehouseFk: null, @@ -53,50 +49,17 @@ const onSave = async () => { :filter="{ fields: ['etd'] }" @on-fetch="updateDefaultStop" /> - - - - - -
- -
-
- -
-
- - - + +import { computed, ref } from 'vue'; +import { useI18n } from 'vue-i18n'; +import FetchData from 'components/FetchData.vue'; +import VnSelectFilter from 'components/common/VnSelectFilter.vue'; +import VnInputDate from 'components/common/VnInputDate.vue'; +import VnInputTime from 'components/common/VnInputTime.vue'; +import VnInput from 'components/common/VnInput.vue'; + +const props = defineProps({ + formData: { + type: Object, + default: () => ({}), + }, + roadmapFk: { + type: [Number, String], + required: true, + }, + layout: { + type: String, + default: 'row', + }, +}); + +const { t } = useI18n(); +const warehouseList = ref([]); +const form = computed(() => props.formData); +const isDialog = computed(() => props.layout === 'dialog'); + + + + +es: + Warehouse: Almacén + ETA date: Fecha ETA + ETA hour: Hora ETA + Description: Descripción + Remove stop: Eliminar parada + Add stop: Añadir parada + diff --git a/src/pages/Route/Roadmap/RoadmapStops.vue b/src/pages/Route/Roadmap/RoadmapStops.vue index 9dbf44af4..10d6e6066 100644 --- a/src/pages/Route/Roadmap/RoadmapStops.vue +++ b/src/pages/Route/Roadmap/RoadmapStops.vue @@ -4,16 +4,11 @@ import { useRoute } from 'vue-router'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import FetchData from 'components/FetchData.vue'; import { onMounted, ref } from 'vue'; -import VnSelectFilter from 'components/common/VnSelectFilter.vue'; -import VnInputDate from 'components/common/VnInputDate.vue'; -import VnInputTime from 'components/common/VnInputTime.vue'; -import VnInput from 'components/common/VnInput.vue'; -import VnRow from 'components/ui/VnRow.vue'; import CrudModel from 'components/CrudModel.vue'; +import RoadmapAddStopForm from "pages/Route/Roadmap/RoadmapAddStopForm.vue"; const { t } = useI18n(); const route = useRoute(); -const warehouseList = ref([]); const roadmapStopsCrudRef = ref(null); const defaultStop = ref({ @@ -39,14 +34,6 @@ onMounted(() => { :filter="{ fields: ['etd'] }" @on-fetch="updateDefaultStop" /> -
{ >