diff --git a/src/components/AddressPreview.vue b/src/components/AddressPreview.vue new file mode 100644 index 0000000..8f0c3b6 --- /dev/null +++ b/src/components/AddressPreview.vue @@ -0,0 +1,42 @@ + + + + + \ No newline at end of file diff --git a/src/components/FormLoadModal.vue b/src/components/FormLoadModal.vue index bbf2340..f90b16f 100644 --- a/src/components/FormLoadModal.vue +++ b/src/components/FormLoadModal.vue @@ -4,8 +4,6 @@ import Custominput from './ui/CustomInput.vue'; import Segments from './ui/Segments.vue'; import TruckTypes from './ui/TruckTypes.vue'; - import Cities from './ui/Cities.vue'; - import States from './ui/States.vue'; import Spiner from './ui/Spiner.vue'; import Products from './ui/Products.vue'; import { GoogleMap, Marker, Polyline } from "vue3-google-map"; @@ -17,7 +15,8 @@ import { useI18n } from 'vue-i18n'; import { computed } from 'vue'; import {getDateTime } from '../helpers/date_formats'; -import { validateEmail } from '../helpers/validations'; + import { validateEmail } from '../helpers/validations'; +import AddressPreview from './AddressPreview.vue'; const loadStore = useLoadsStore(); @@ -81,6 +80,8 @@ import { validateEmail } from '../helpers/validations'; zoom.value = 4; heightMap.value = 420; } + getLocations('unloading'); + getLocations('loading'); formLoad.owner = auth.user?.first_name + ' ' + auth.user?.last_name; if(loadStore.currentLoad){ const dateStart = getDateTime(loadStore.currentLoad.est_loading_date, 0); @@ -113,7 +114,8 @@ import { validateEmail } from '../helpers/validations'; destination.country = loadStore.currentLoad.destination.country; destination.postalCode = loadStore.currentLoad.destination.zipcode; destinationRef.value = loadStore.currentLoad.destination.landmark; - locationLoadSelected.value = loadStore.currentLoad?.shipper_warehouse || null; /// Selected warehouse + locationLoadSelected.value = loadStore.currentLoad?.origin_warehouse || null; /// Selected warehouse origin + locationDownloadSelected.value = loadStore.currentLoad?.destination_warehouse || null; /// Selected warehouse destination emails.value = loadStore.currentLoad?.alert_list || []; getCoordsMap(); } @@ -252,10 +254,13 @@ import { validateEmail } from '../helpers/validations'; company: auth.user.company, posted_by: auth.user._id, posted_by_name: formLoad.owner, - shipper_warehouse: locationLoadSelected.value?._id || null, + origin_warehouse: locationLoadSelected.value?._id || null, + destination_warehouse: locationDownloadSelected.value?._id || null, alert_list: emails.value.length > 0 ? emails.value : null }; + console.log(loadData); + return loadData; } @@ -268,7 +273,8 @@ import { validateEmail } from '../helpers/validations'; company: auth.user.company, categories: formLoad.segment || null, product: formLoad.terms?.length <= 0 ? null : formLoad.terms, - shipper_warehouse: locationLoadSelected.value, + origin_warehouse: locationLoadSelected.value, + destination_warehouse: locationDownloadSelected.value, }; if(resp) { const index = loadStore.loads.findIndex((load) => load._id === resp._id); @@ -289,7 +295,8 @@ import { validateEmail } from '../helpers/validations'; ...resp, ...loadData, categories: [loadData.categories], - shipper_warehouse: locationLoadSelected.value, + origin_warehouse: locationLoadSelected.value, + destination_warehouse: locationDownloadSelected.value, } loadStore.loads.unshift(load); @@ -523,88 +530,29 @@ import { validateEmail } from '../helpers/validations';
-

{{ t('loads.addressOrigin') }}

- -
- - -
-
- +
+
- - -
- - - {{ errors.cityOrigin }} -
-
- - - {{ errors.stateOrigin }} -
- - -
-

{{ t('loads.addressDestination') }}

-
- - -
-
- +
+
- - -
- - - {{ errors.cityDestination }} -
-
- - - {{ errors.stateDestination }} -
- - -