forked from verdnatura/salix-front
Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7197-fixInvoiceIn
This commit is contained in:
commit
262742fee3
|
@ -148,7 +148,7 @@ async function onSubmit() {
|
||||||
await saveChanges($props.saveFn ? formData.value : null);
|
await saveChanges($props.saveFn ? formData.value : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onSumbitAndGo() {
|
async function onSubmitAndGo() {
|
||||||
await onSubmit();
|
await onSubmit();
|
||||||
push({ path: $props.goTo });
|
push({ path: $props.goTo });
|
||||||
}
|
}
|
||||||
|
@ -337,7 +337,7 @@ watch(formUrl, async () => {
|
||||||
/>
|
/>
|
||||||
<QBtnDropdown
|
<QBtnDropdown
|
||||||
v-if="$props.goTo && $props.defaultSave"
|
v-if="$props.goTo && $props.defaultSave"
|
||||||
@click="onSumbitAndGo"
|
@click="onSubmitAndGo"
|
||||||
:label="tMobile('globals.saveAndContinue')"
|
:label="tMobile('globals.saveAndContinue')"
|
||||||
:title="t('globals.saveAndContinue')"
|
:title="t('globals.saveAndContinue')"
|
||||||
:disable="!hasChanges"
|
:disable="!hasChanges"
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
<script setup>
|
||||||
|
defineProps({
|
||||||
|
title: { type: String, default: null },
|
||||||
|
content: { type: [String, Number], default: null },
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<QPopupProxy>
|
||||||
|
<QCard>
|
||||||
|
<slot name="title">
|
||||||
|
<div
|
||||||
|
class="header q-px-sm q-py-xs q-ma-none text-white text-bold bg-primary"
|
||||||
|
v-text="title"
|
||||||
|
/>
|
||||||
|
</slot>
|
||||||
|
<slot name="content">
|
||||||
|
<QCardSection class="change-detail q-pa-sm">
|
||||||
|
{{ content }}
|
||||||
|
</QCardSection>
|
||||||
|
</slot>
|
||||||
|
</QCard>
|
||||||
|
</QPopupProxy>
|
||||||
|
</template>
|
|
@ -39,6 +39,7 @@ const $props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const state = useState();
|
const state = useState();
|
||||||
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
let arrayData;
|
let arrayData;
|
||||||
|
@ -57,7 +58,7 @@ onBeforeMount(async () => {
|
||||||
store = arrayData.store;
|
store = arrayData.store;
|
||||||
entity = computed(() => (Array.isArray(store.data) ? store.data[0] : store.data));
|
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
|
// 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(
|
watch(
|
||||||
() => [$props.url, $props.filter],
|
() => [$props.url, $props.filter],
|
||||||
async () => await getData()
|
async () => await getData()
|
||||||
|
|
|
@ -113,6 +113,7 @@ globals:
|
||||||
name: Name
|
name: Name
|
||||||
new: New
|
new: New
|
||||||
comment: Comment
|
comment: Comment
|
||||||
|
observations: Observations
|
||||||
unsavedPopup:
|
unsavedPopup:
|
||||||
title: Unsaved changes will be lost
|
title: Unsaved changes will be lost
|
||||||
subtitle: Are you sure exit without saving?
|
subtitle: Are you sure exit without saving?
|
||||||
|
|
|
@ -113,6 +113,7 @@ globals:
|
||||||
name: Nombre
|
name: Nombre
|
||||||
new: Nuevo
|
new: Nuevo
|
||||||
comment: Comentario
|
comment: Comentario
|
||||||
|
observations: Observaciones
|
||||||
unsavedPopup:
|
unsavedPopup:
|
||||||
title: Los cambios que no haya guardado se perderán
|
title: Los cambios que no haya guardado se perderán
|
||||||
subtitle: ¿Seguro que quiere salir sin guardar?
|
subtitle: ¿Seguro que quiere salir sin guardar?
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
import { onMounted, ref, computed, watch } from 'vue';
|
import { onMounted, ref, computed, watch } from 'vue';
|
||||||
import { QBtn } from 'quasar';
|
import { QBtn } from 'quasar';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
|
|
||||||
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
||||||
import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.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 VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
import VnPopup from 'src/components/common/VnPopup.vue';
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { openReport } = usePrintService();
|
const { openReport } = usePrintService();
|
||||||
|
@ -125,6 +124,10 @@ const tableColumnComponents = {
|
||||||
component: 'span',
|
component: 'span',
|
||||||
attrs: {},
|
attrs: {},
|
||||||
},
|
},
|
||||||
|
notes: {
|
||||||
|
component: 'span',
|
||||||
|
attrs: {},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
|
@ -250,6 +253,14 @@ const columns = computed(() => [
|
||||||
sortable: true,
|
sortable: true,
|
||||||
format: (value) => toDate(value),
|
format: (value) => toDate(value),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: t('notes'),
|
||||||
|
field: '',
|
||||||
|
name: 'notes',
|
||||||
|
align: 'center',
|
||||||
|
showValue: false,
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
async function getData() {
|
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) => {
|
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
|
// 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;
|
if (!['ref', 'id', 'cargoSupplierNickname', 'kg'].includes(col.name)) return;
|
||||||
|
@ -486,7 +493,7 @@ const getColor = (percentage) => {
|
||||||
<QTr
|
<QTr
|
||||||
:props="props"
|
:props="props"
|
||||||
class="cursor-pointer bg-travel"
|
class="cursor-pointer bg-travel"
|
||||||
@click="navigateToTravelId(props.row.id)"
|
@click="$router.push({ path: `/travel/${props.row.id}` })"
|
||||||
@dragenter="handleDragEnter($event, props.rowIndex)"
|
@dragenter="handleDragEnter($event, props.rowIndex)"
|
||||||
@dragover.prevent
|
@dragover.prevent
|
||||||
@drop="handleDrop()"
|
@drop="handleDrop()"
|
||||||
|
@ -607,6 +614,20 @@ const getColor = (percentage) => {
|
||||||
<QTd />
|
<QTd />
|
||||||
<QTd />
|
<QTd />
|
||||||
<QTd />
|
<QTd />
|
||||||
|
<QTd>
|
||||||
|
<QBtn
|
||||||
|
v-if="entry.evaNotes"
|
||||||
|
icon="comment"
|
||||||
|
size="sm"
|
||||||
|
flat
|
||||||
|
color="primary"
|
||||||
|
>
|
||||||
|
<VnPopup
|
||||||
|
:title="t('globals.observations')"
|
||||||
|
:content="entry.evaNotes"
|
||||||
|
/>
|
||||||
|
</QBtn>
|
||||||
|
</QTd>
|
||||||
</QTr>
|
</QTr>
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
</QTable>
|
||||||
|
|
Loading…
Reference in New Issue