diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index f3280511c..76de49e6c 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -148,7 +148,7 @@ async function onSubmit() { await saveChanges($props.saveFn ? formData.value : null); } -async function onSumbitAndGo() { +async function onSubmitAndGo() { await onSubmit(); push({ path: $props.goTo }); } @@ -337,7 +337,7 @@ watch(formUrl, async () => { /> +defineProps({ + title: { type: String, default: null }, + content: { type: [String, Number], default: null }, +}); + + diff --git a/src/components/ui/CardDescriptor.vue b/src/components/ui/CardDescriptor.vue index b2084479d..8bb2a603e 100644 --- a/src/components/ui/CardDescriptor.vue +++ b/src/components/ui/CardDescriptor.vue @@ -39,6 +39,7 @@ const $props = defineProps({ }); const state = useState(); +const route = useRoute(); const { t } = useI18n(); const { viewSummary } = useSummaryDialog(); let arrayData; @@ -57,7 +58,7 @@ onBeforeMount(async () => { store = arrayData.store; entity = computed(() => (Array.isArray(store.data) ? store.data[0] : store.data)); // It enables to load data only once if the module is the same as the dataKey - if ($props.dataKey !== useRoute().meta.moduleName) await getData(); + if ($props.dataKey !== route.meta.moduleName || !route.params.id) await getData(); watch( () => [$props.url, $props.filter], async () => await getData() diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 7ace15cce..1cf2c0302 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -113,6 +113,7 @@ globals: name: Name new: New comment: Comment + observations: Observations unsavedPopup: title: Unsaved changes will be lost subtitle: Are you sure exit without saving? diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index a2f4f508b..5932740e2 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -113,6 +113,7 @@ globals: name: Nombre new: Nuevo comment: Comentario + observations: Observaciones unsavedPopup: title: Los cambios que no haya guardado se perderán subtitle: ¿Seguro que quiere salir sin guardar? diff --git a/src/pages/Travel/ExtraCommunity.vue b/src/pages/Travel/ExtraCommunity.vue index 639c7d894..98648512f 100644 --- a/src/pages/Travel/ExtraCommunity.vue +++ b/src/pages/Travel/ExtraCommunity.vue @@ -2,7 +2,6 @@ import { onMounted, ref, computed, watch } from 'vue'; import { QBtn } from 'quasar'; import { useI18n } from 'vue-i18n'; -import { useRouter } from 'vue-router'; import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue'; import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue'; @@ -19,8 +18,8 @@ import { usePrintService } from 'composables/usePrintService'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import axios from 'axios'; import RightMenu from 'src/components/common/RightMenu.vue'; +import VnPopup from 'src/components/common/VnPopup.vue'; -const router = useRouter(); const stateStore = useStateStore(); const { t } = useI18n(); const { openReport } = usePrintService(); @@ -125,6 +124,10 @@ const tableColumnComponents = { component: 'span', attrs: {}, }, + notes: { + component: 'span', + attrs: {}, + }, }; const columns = computed(() => [ @@ -250,6 +253,14 @@ const columns = computed(() => [ sortable: true, format: (value) => toDate(value), }, + { + label: t('notes'), + field: '', + name: 'notes', + align: 'center', + showValue: false, + sortable: true, + }, ]); async function getData() { @@ -298,10 +309,6 @@ const saveFieldValue = async (val, field, index) => { } }; -const navigateToTravelId = (id) => { - router.push({ path: `/travel/${id}` }); -}; - const stopEventPropagation = (event, col) => { // Detener la propagación del evento de los siguientes elementos para evitar el click sobre la row que dispararía la función navigateToTravelId if (!['ref', 'id', 'cargoSupplierNickname', 'kg'].includes(col.name)) return; @@ -486,7 +493,7 @@ const getColor = (percentage) => { { + + + + +