forked from verdnatura/salix-front
Merge pull request 'CambiosSolicitadosSuppliers' (!214) from hyervoni/salix-front-mindshore:CambiosSolicitadosSuppliers into dev
Reviewed-on: verdnatura/salix-front#214 Reviewed-by: Javi Gallego <jgallego@verdnatura.es> Reviewed-by: Javier Segarra <jsegarra@verdnatura.es> Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
commit
e1cf13076f
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref, onMounted, nextTick } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
|
||||||
|
@ -16,9 +16,8 @@ const props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['onDataSaved']);
|
const emit = defineEmits(['onDataSaved']);
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const bicInputRef = ref(null);
|
||||||
const bankEntityFormData = reactive({
|
const bankEntityFormData = reactive({
|
||||||
name: null,
|
name: null,
|
||||||
bic: null,
|
bic: null,
|
||||||
|
@ -32,9 +31,14 @@ const countriesFilter = {
|
||||||
|
|
||||||
const countriesOptions = ref([]);
|
const countriesOptions = ref([]);
|
||||||
|
|
||||||
const onDataSaved = (data) => {
|
const onDataSaved = (formData, requestResponse) => {
|
||||||
emit('onDataSaved', data);
|
emit('onDataSaved', formData, requestResponse);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await nextTick();
|
||||||
|
bicInputRef.value.focus();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -50,7 +54,7 @@ const onDataSaved = (data) => {
|
||||||
:title="t('title')"
|
:title="t('title')"
|
||||||
:subtitle="t('subtitle')"
|
:subtitle="t('subtitle')"
|
||||||
:form-initial-data="bankEntityFormData"
|
:form-initial-data="bankEntityFormData"
|
||||||
@on-data-saved="onDataSaved($event)"
|
@on-data-saved="onDataSaved"
|
||||||
>
|
>
|
||||||
<template #form-inputs="{ data, validate }">
|
<template #form-inputs="{ data, validate }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
|
@ -64,6 +68,7 @@ const onDataSaved = (data) => {
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnInput
|
<VnInput
|
||||||
|
ref="bicInputRef"
|
||||||
:label="t('swift')"
|
:label="t('swift')"
|
||||||
v-model="data.bic"
|
v-model="data.bic"
|
||||||
:required="true"
|
:required="true"
|
||||||
|
|
|
@ -66,6 +66,10 @@ const $props = defineProps({
|
||||||
type: Function,
|
type: Function,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
clearStoreOnUnmount: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
saveFn: {
|
saveFn: {
|
||||||
type: Function,
|
type: Function,
|
||||||
default: null,
|
default: null,
|
||||||
|
@ -114,7 +118,12 @@ onBeforeRouteLeave((to, from, next) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
state.unset($props.model);
|
// Restauramos los datos originales en el store si se realizaron cambios en el formulario pero no se guardaron, evitando modificaciones erróneas.
|
||||||
|
if (hasChanges.value) {
|
||||||
|
state.set($props.model, originalData.value);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ($props.clearStoreOnUnmount) state.unset($props.model);
|
||||||
});
|
});
|
||||||
|
|
||||||
const isLoading = ref(false);
|
const isLoading = ref(false);
|
||||||
|
|
|
@ -42,8 +42,8 @@ const { t } = useI18n();
|
||||||
const closeButton = ref(null);
|
const closeButton = ref(null);
|
||||||
const isLoading = ref(false);
|
const isLoading = ref(false);
|
||||||
|
|
||||||
const onDataSaved = (dataSaved) => {
|
const onDataSaved = (formData, requestResponse) => {
|
||||||
emit('onDataSaved', dataSaved);
|
emit('onDataSaved', formData, requestResponse);
|
||||||
closeForm();
|
closeForm();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ const closeForm = () => {
|
||||||
:default-actions="false"
|
:default-actions="false"
|
||||||
:url-create="urlCreate"
|
:url-create="urlCreate"
|
||||||
:model="model"
|
:model="model"
|
||||||
@on-data-saved="onDataSaved($event)"
|
@on-data-saved="onDataSaved"
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<span ref="closeButton" class="close-icon" v-close-popup>
|
<span ref="closeButton" class="close-icon" v-close-popup>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue', 'update:options', 'keyup.enter']);
|
const emit = defineEmits(['update:modelValue', 'update:options', 'keyup.enter']);
|
||||||
|
@ -17,7 +17,7 @@ const $props = defineProps({
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const requiredFieldRule = (val) => !!val || t('globals.fieldRequired');
|
const requiredFieldRule = (val) => !!val || t('globals.fieldRequired');
|
||||||
|
const vnInputRef = ref(null);
|
||||||
const value = computed({
|
const value = computed({
|
||||||
get() {
|
get() {
|
||||||
return $props.modelValue;
|
return $props.modelValue;
|
||||||
|
@ -40,6 +40,14 @@ const styleAttrs = computed(() => {
|
||||||
const onEnterPress = () => {
|
const onEnterPress = () => {
|
||||||
emit('keyup.enter');
|
emit('keyup.enter');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const focus = () => {
|
||||||
|
vnInputRef.value.focus();
|
||||||
|
};
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
focus,
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n';
|
||||||
import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue';
|
import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
|
import { useState } from 'src/composables/useState';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
url: {
|
url: {
|
||||||
|
@ -35,6 +36,8 @@ const $props = defineProps({
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const state = useState();
|
||||||
const slots = useSlots();
|
const slots = useSlots();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
|
@ -64,6 +67,7 @@ async function getData() {
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
try {
|
try {
|
||||||
const { data } = await arrayData.fetch({ append: false, updateRouter: false });
|
const { data } = await arrayData.fetch({ append: false, updateRouter: false });
|
||||||
|
state.set($props.dataKey, data);
|
||||||
emit('onFetch', data);
|
emit('onFetch', data);
|
||||||
} finally {
|
} finally {
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, watch } from 'vue';
|
import { onMounted, ref, watch } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import SkeletonSummary from 'components/ui/SkeletonSummary.vue';
|
import SkeletonSummary from 'components/ui/SkeletonSummary.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
|
|
||||||
onMounted(() => fetch());
|
|
||||||
|
|
||||||
const entity = ref();
|
const entity = ref();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
url: {
|
url: {
|
||||||
|
@ -16,14 +15,25 @@ const props = defineProps({
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
entityId: {
|
||||||
|
type: Number,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const emit = defineEmits(['onFetch']);
|
const emit = defineEmits(['onFetch']);
|
||||||
|
const route = useRoute();
|
||||||
|
const isSummary = ref();
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
entity,
|
entity,
|
||||||
fetch,
|
fetch,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
isSummary.value = String(route.path).endsWith('/summary');
|
||||||
|
fetch();
|
||||||
|
});
|
||||||
|
|
||||||
async function fetch() {
|
async function fetch() {
|
||||||
const params = {};
|
const params = {};
|
||||||
|
|
||||||
|
@ -48,7 +58,17 @@ watch(props, async () => {
|
||||||
<template v-if="entity">
|
<template v-if="entity">
|
||||||
<div class="summaryHeader bg-primary q-pa-sm text-weight-bolder">
|
<div class="summaryHeader bg-primary q-pa-sm text-weight-bolder">
|
||||||
<slot name="header-left">
|
<slot name="header-left">
|
||||||
<span></span>
|
<router-link
|
||||||
|
v-if="!isSummary && route.meta.moduleName"
|
||||||
|
class="header link"
|
||||||
|
:to="{
|
||||||
|
name: `${route.meta.moduleName}Summary`,
|
||||||
|
params: { id: entityId || entity.id },
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<QIcon name="open_in_new" color="white" size="sm" />
|
||||||
|
</router-link>
|
||||||
|
<span v-else></span>
|
||||||
</slot>
|
</slot>
|
||||||
<slot name="header" :entity="entity">
|
<slot name="header" :entity="entity">
|
||||||
<VnLv :label="`${entity.id} -`" :value="entity.name" />
|
<VnLv :label="`${entity.id} -`" :value="entity.name" />
|
||||||
|
|
|
@ -118,7 +118,12 @@ async function search() {
|
||||||
autofocus
|
autofocus
|
||||||
>
|
>
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<QIcon name="search" v-if="!quasar.platform.is.mobile" />
|
<QIcon
|
||||||
|
v-if="!quasar.platform.is.mobile"
|
||||||
|
class="cursor-pointer"
|
||||||
|
name="search"
|
||||||
|
@click="search"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #append>
|
<template #append>
|
||||||
<QIcon
|
<QIcon
|
||||||
|
|
|
@ -172,6 +172,7 @@ function openDialog(dmsId) {
|
||||||
<CardSummary
|
<CardSummary
|
||||||
ref="summary"
|
ref="summary"
|
||||||
:url="`Claims/${entityId}/getSummary`"
|
:url="`Claims/${entityId}/getSummary`"
|
||||||
|
:entity-id="entityId"
|
||||||
@on-fetch="getClaimDms"
|
@on-fetch="getClaimDms"
|
||||||
>
|
>
|
||||||
<template #header="{ entity: { claim } }">
|
<template #header="{ entity: { claim } }">
|
||||||
|
|
|
@ -172,7 +172,6 @@ const fetchEntryBuys = async () => {
|
||||||
<template #header>
|
<template #header>
|
||||||
<span>{{ entry.id }} - {{ entry.supplier.nickname }}</span>
|
<span>{{ entry.id }} - {{ entry.supplier.nickname }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #body>
|
<template #body>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<a class="header header-link" :href="`#/entry/${entityId}/basic-data`">
|
<a class="header header-link" :href="`#/entry/${entityId}/basic-data`">
|
||||||
|
|
|
@ -95,7 +95,11 @@ const ticketsColumns = ref([
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CardSummary ref="summary" :url="`InvoiceOuts/${entityId}/summary`">
|
<CardSummary
|
||||||
|
ref="summary"
|
||||||
|
:url="`InvoiceOuts/${entityId}/summary`"
|
||||||
|
:entity-id="entityId"
|
||||||
|
>
|
||||||
<template #header="{ entity: { invoiceOut } }">
|
<template #header="{ entity: { invoiceOut } }">
|
||||||
<div>{{ invoiceOut.ref }} - {{ invoiceOut.client?.socialName }}</div>
|
<div>{{ invoiceOut.ref }} - {{ invoiceOut.client?.socialName }}</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -132,12 +132,11 @@ const openBuscaman = async (route, ticket) => {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="q-pa-md">
|
<div class="q-pa-md">
|
||||||
<CardSummary ref="summary" :url="`Routes/${entityId}/summary`">
|
<CardSummary
|
||||||
<template #header-left>
|
ref="summary"
|
||||||
<RouterLink :to="{ name: `RouteSummary`, params: { id: entityId } }">
|
:url="`Routes/${entityId}/summary`"
|
||||||
<QIcon name="open_in_new" color="white" size="sm" />
|
:entity-id="entityId"
|
||||||
</RouterLink>
|
>
|
||||||
</template>
|
|
||||||
<template #header="{ entity }">
|
<template #header="{ entity }">
|
||||||
<span>{{ `${entity?.route.id} - ${entity?.route?.description}` }}</span>
|
<span>{{ `${entity?.route.id} - ${entity?.route?.description}` }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -18,13 +18,16 @@ const quasar = useQuasar();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
const bankEntitiesRef = ref(null);
|
||||||
const supplier = ref(null);
|
const supplier = ref(null);
|
||||||
const supplierAccountRef = ref(null);
|
const supplierAccountRef = ref(null);
|
||||||
const wireTransferFk = ref(null);
|
const wireTransferFk = ref(null);
|
||||||
const bankEntitiesOptions = ref([]);
|
const bankEntitiesOptions = ref([]);
|
||||||
|
|
||||||
const onBankEntityCreated = (data) => {
|
const onBankEntityCreated = async (dataSaved, rowData) => {
|
||||||
bankEntitiesOptions.value.push(data);
|
await bankEntitiesRef.value.fetch();
|
||||||
|
rowData.bankEntityFk = dataSaved.id;
|
||||||
};
|
};
|
||||||
|
|
||||||
const onChangesSaved = () => {
|
const onChangesSaved = () => {
|
||||||
|
@ -63,6 +66,7 @@ onMounted(() => {
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
ref="bankEntitiesRef"
|
||||||
url="BankEntities"
|
url="BankEntities"
|
||||||
@on-fetch="(data) => (bankEntitiesOptions = data)"
|
@on-fetch="(data) => (bankEntitiesOptions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
|
@ -114,13 +118,16 @@ onMounted(() => {
|
||||||
:label="t('worker.create.bankEntity')"
|
:label="t('worker.create.bankEntity')"
|
||||||
v-model="row.bankEntityFk"
|
v-model="row.bankEntityFk"
|
||||||
:options="bankEntitiesOptions"
|
:options="bankEntitiesOptions"
|
||||||
option-label="name"
|
option-label="bic"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
hide-selected
|
hide-selected
|
||||||
>
|
>
|
||||||
<template #form>
|
<template #form>
|
||||||
<CreateBankEntityForm
|
<CreateBankEntityForm
|
||||||
@on-data-saved="onBankEntityCreated($event)"
|
@on-data-saved="
|
||||||
|
(_, requestResponse) =>
|
||||||
|
onBankEntityCreated(requestResponse, row)
|
||||||
|
"
|
||||||
:show-entity-field="false"
|
:show-entity-field="false"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -83,8 +83,13 @@ const redirectToUpdateView = (addressData) => {
|
||||||
<QPageSticky :offset="[20, 20]">
|
<QPageSticky :offset="[20, 20]">
|
||||||
<QBtn fab icon="add" color="primary" @click="redirectToCreateView()" />
|
<QBtn fab icon="add" color="primary" @click="redirectToCreateView()" />
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('supplier.list.newSupplier') }}
|
{{ t('New address') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QPageSticky>
|
</QPageSticky>
|
||||||
</QPage>
|
</QPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<i18n>
|
||||||
|
es:
|
||||||
|
New address: Nueva dirección
|
||||||
|
</i18n>
|
||||||
|
|
|
@ -26,6 +26,7 @@ const workersOptions = ref([]);
|
||||||
:url-update="`Suppliers/${route.params.id}`"
|
:url-update="`Suppliers/${route.params.id}`"
|
||||||
model="supplier"
|
model="supplier"
|
||||||
auto-load
|
auto-load
|
||||||
|
:clear-store-on-unmount="false"
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
|
|
|
@ -33,6 +33,7 @@ const formatPayDems = (data) => {
|
||||||
:url-update="`Suppliers/${route.params.id}`"
|
:url-update="`Suppliers/${route.params.id}`"
|
||||||
model="supplier"
|
model="supplier"
|
||||||
auto-load
|
auto-load
|
||||||
|
:clear-store-on-unmount="false"
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted, nextTick } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
@ -11,6 +11,15 @@ const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const supplierContactRef = ref(null);
|
const supplierContactRef = ref(null);
|
||||||
|
|
||||||
|
const insertRow = () => {
|
||||||
|
supplierContactRef.value.insert();
|
||||||
|
nextTick(() => {
|
||||||
|
const inputs = document.querySelectorAll('[input-name-focusable]');
|
||||||
|
const lastInput = inputs[inputs.length - 1];
|
||||||
|
if (lastInput) lastInput.focus();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (supplierContactRef.value) supplierContactRef.value.reload();
|
if (supplierContactRef.value) supplierContactRef.value.reload();
|
||||||
});
|
});
|
||||||
|
@ -38,6 +47,7 @@ onMounted(() => {
|
||||||
<VnRow class="row q-gutter-md">
|
<VnRow class="row q-gutter-md">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnInput
|
<VnInput
|
||||||
|
input-name-focusable
|
||||||
:label="t('supplier.contacts.name')"
|
:label="t('supplier.contacts.name')"
|
||||||
v-model="row.name"
|
v-model="row.name"
|
||||||
/>
|
/>
|
||||||
|
@ -92,7 +102,7 @@ onMounted(() => {
|
||||||
size="sm"
|
size="sm"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
color="primary"
|
color="primary"
|
||||||
@click="supplierContactRef.insert()"
|
@click="insertRow()"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('Add contact') }}
|
{{ t('Add contact') }}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import { toDateString } from 'src/filters';
|
import { toDateString } from 'src/filters';
|
||||||
import useCardDescription from 'src/composables/useCardDescription';
|
import useCardDescription from 'src/composables/useCardDescription';
|
||||||
import { getUrl } from 'src/composables/getUrl';
|
import { getUrl } from 'src/composables/getUrl';
|
||||||
|
import { useState } from 'src/composables/useState';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
@ -21,6 +22,7 @@ const $props = defineProps({
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const url = ref();
|
const url = ref();
|
||||||
|
const state = useState();
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
fields: [
|
fields: [
|
||||||
|
@ -71,6 +73,8 @@ const setData = (entity) => {
|
||||||
data.value = useCardDescription(entity.ref, entity.id);
|
data.value = useCardDescription(entity.ref, entity.id);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const supplier = computed(() => state.get('supplier'));
|
||||||
|
|
||||||
const getEntryQueryParams = (supplier) => {
|
const getEntryQueryParams = (supplier) => {
|
||||||
if (!supplier) return null;
|
if (!supplier) return null;
|
||||||
|
|
||||||
|
@ -101,7 +105,7 @@ const getEntryQueryParams = (supplier) => {
|
||||||
:subtitle="data.subtitle"
|
:subtitle="data.subtitle"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
data-key="Supplier"
|
data-key="supplier"
|
||||||
>
|
>
|
||||||
<template #header-extra-action>
|
<template #header-extra-action>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
@ -133,10 +137,10 @@ const getEntryQueryParams = (supplier) => {
|
||||||
<VnLv :label="t('supplier.summary.payDay')" :value="entity.payDay" />
|
<VnLv :label="t('supplier.summary.payDay')" :value="entity.payDay" />
|
||||||
<VnLv :label="t('supplier.summary.account')" :value="entity.account" />
|
<VnLv :label="t('supplier.summary.account')" :value="entity.account" />
|
||||||
</template>
|
</template>
|
||||||
<template #icons="{ entity }">
|
<template #icons>
|
||||||
<QCardActions class="q-gutter-x-md">
|
<QCardActions v-if="supplier" class="q-gutter-x-md">
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="!entity.isActive"
|
v-if="!supplier.isActive"
|
||||||
name="vn:disabled"
|
name="vn:disabled"
|
||||||
color="primary"
|
color="primary"
|
||||||
size="xs"
|
size="xs"
|
||||||
|
@ -144,7 +148,7 @@ const getEntryQueryParams = (supplier) => {
|
||||||
<QTooltip>{{ t('Inactive supplier') }}</QTooltip>
|
<QTooltip>{{ t('Inactive supplier') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="!entity.isSerious"
|
v-if="!supplier.isSerious"
|
||||||
name="vn:supplierfalse"
|
name="vn:supplierfalse"
|
||||||
color="primary"
|
color="primary"
|
||||||
size="xs"
|
size="xs"
|
||||||
|
@ -167,6 +171,7 @@ const getEntryQueryParams = (supplier) => {
|
||||||
<QTooltip>{{ t('All entries with current supplier') }}</QTooltip>
|
<QTooltip>{{ t('All entries with current supplier') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
v-if="entity.client?.fi"
|
||||||
:to="{
|
:to="{
|
||||||
name: 'CustomerCard',
|
name: 'CustomerCard',
|
||||||
params: { id: entity.client?.id },
|
params: { id: entity.client?.id },
|
||||||
|
|
|
@ -53,6 +53,7 @@ function handleLocation(data, location) {
|
||||||
:url-update="`Suppliers/${route.params.id}/updateFiscalData`"
|
:url-update="`Suppliers/${route.params.id}/updateFiscalData`"
|
||||||
model="supplier"
|
model="supplier"
|
||||||
auto-load
|
auto-load
|
||||||
|
:clear-store-on-unmount="false"
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
|
|
|
@ -51,25 +51,20 @@ const isAdministrative = computed(() => {
|
||||||
:url="`Suppliers/${entityId}/getSummary`"
|
:url="`Suppliers/${entityId}/getSummary`"
|
||||||
@on-fetch="(data) => setData(data)"
|
@on-fetch="(data) => setData(data)"
|
||||||
>
|
>
|
||||||
<template #header-left>
|
|
||||||
<a v-if="isAdministrative" class="header header-link" :href="supplierUrl">
|
|
||||||
<QIcon name="open_in_new" color="white" size="sm" />
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
<template #header>
|
<template #header>
|
||||||
<span>{{ supplier.name }} - {{ supplier.id }}</span>
|
<span>{{ supplier.name }} - {{ supplier.id }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #body>
|
<template #body>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<a
|
<router-link
|
||||||
v-if="isAdministrative"
|
v-if="isAdministrative"
|
||||||
class="header header-link"
|
class="header link"
|
||||||
:href="`#/supplier/${entityId}/basic-data`"
|
:to="{ name: 'SupplierBasicData', params: { id: entityId } }"
|
||||||
>
|
>
|
||||||
{{ t('globals.summary.basicData') }}
|
{{ t('globals.summary.basicData') }}
|
||||||
<QIcon name="open_in_new" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</router-link>
|
||||||
<span v-else> {{ t('globals.summary.basicData') }}</span>
|
<span v-else> {{ t('globals.summary.basicData') }}</span>
|
||||||
<VnLv label="Id" :value="supplier.id" />
|
<VnLv label="Id" :value="supplier.id" />
|
||||||
<VnLv label="Alias" :value="supplier.nickname" />
|
<VnLv label="Alias" :value="supplier.nickname" />
|
||||||
|
@ -98,14 +93,14 @@ const isAdministrative = computed(() => {
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<a
|
<router-link
|
||||||
v-if="isAdministrative"
|
v-if="isAdministrative"
|
||||||
class="header header-link"
|
class="header link"
|
||||||
:href="`#/supplier/${entityId}/billing-data`"
|
:to="{ name: 'SupplierBillingData', params: { id: entityId } }"
|
||||||
>
|
>
|
||||||
{{ t('supplier.summary.billingData') }}
|
{{ t('supplier.summary.billingData') }}
|
||||||
<QIcon name="open_in_new" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</router-link>
|
||||||
<span v-else> {{ t('supplier.summary.billingData') }}</span>
|
<span v-else> {{ t('supplier.summary.billingData') }}</span>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('supplier.summary.payMethod')"
|
:label="t('supplier.summary.payMethod')"
|
||||||
|
@ -121,14 +116,14 @@ const isAdministrative = computed(() => {
|
||||||
<VnLv :label="t('supplier.summary.account')" :value="supplier.account" />
|
<VnLv :label="t('supplier.summary.account')" :value="supplier.account" />
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<a
|
<router-link
|
||||||
v-if="isAdministrative"
|
v-if="isAdministrative"
|
||||||
class="header header-link"
|
class="header link"
|
||||||
:href="`#/supplier/${entityId}/fiscal-data`"
|
:to="{ name: 'SupplierFiscalData', params: { id: entityId } }"
|
||||||
>
|
>
|
||||||
{{ t('supplier.summary.fiscalData') }}
|
{{ t('supplier.summary.fiscalData') }}
|
||||||
<QIcon name="open_in_new" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</router-link>
|
||||||
<span v-else> {{ t('supplier.summary.fiscalData') }}</span>
|
<span v-else> {{ t('supplier.summary.fiscalData') }}</span>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('supplier.summary.sageTaxType')"
|
:label="t('supplier.summary.sageTaxType')"
|
||||||
|
@ -156,14 +151,14 @@ const isAdministrative = computed(() => {
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<a
|
<router-link
|
||||||
v-if="isAdministrative"
|
v-if="isAdministrative"
|
||||||
class="header header-link"
|
class="header link"
|
||||||
:href="`#/supplier/${entityId}/fiscal-data`"
|
:to="{ name: 'SupplierFiscalData', params: { id: entityId } }"
|
||||||
>
|
>
|
||||||
{{ t('supplier.summary.fiscalAddress') }}
|
{{ t('supplier.summary.fiscalAddress') }}
|
||||||
<QIcon name="open_in_new" />
|
<QIcon name="open_in_new" />
|
||||||
</a>
|
</router-link>
|
||||||
<span v-else> {{ t('supplier.summary.fiscalAddress') }}</span>
|
<span v-else> {{ t('supplier.summary.fiscalAddress') }}</span>
|
||||||
<VnLv :label="t('supplier.summary.socialName')" :value="supplier.name" />
|
<VnLv :label="t('supplier.summary.socialName')" :value="supplier.name" />
|
||||||
<VnLv :label="t('supplier.summary.taxNumber')" :value="supplier.nif" />
|
<VnLv :label="t('supplier.summary.taxNumber')" :value="supplier.nif" />
|
||||||
|
|
|
@ -42,7 +42,7 @@ const redirectToCreateView = () => {
|
||||||
</QScrollArea>
|
</QScrollArea>
|
||||||
</QDrawer>
|
</QDrawer>
|
||||||
<div class="vn-card-list">
|
<div class="vn-card-list">
|
||||||
<VnPaginate data-key="SuppliersList" url="Suppliers/filter" auto-load>
|
<VnPaginate data-key="SuppliersList" url="Suppliers/filter">
|
||||||
<template #body="{ rows }">
|
<template #body="{ rows }">
|
||||||
<CardList
|
<CardList
|
||||||
v-for="row of rows"
|
v-for="row of rows"
|
||||||
|
|
|
@ -236,19 +236,9 @@ async function setTravelData(travelData) {
|
||||||
:url="`Travels/${entityId}/getTravel`"
|
:url="`Travels/${entityId}/getTravel`"
|
||||||
@on-fetch="(data) => setTravelData(data)"
|
@on-fetch="(data) => setTravelData(data)"
|
||||||
>
|
>
|
||||||
<template #header-left>
|
|
||||||
<router-link
|
|
||||||
class="header link"
|
|
||||||
:to="{ name: 'TravelSummary', params: { id: entityId } }"
|
|
||||||
>
|
|
||||||
<QIcon name="open_in_new" color="white" size="sm" />
|
|
||||||
<QTooltip>{{ t('travel.pageTitles.summary') }}</QTooltip>
|
|
||||||
</router-link>
|
|
||||||
</template>
|
|
||||||
<template #header>
|
<template #header>
|
||||||
<span>{{ travel.ref }} - {{ travel.id }}</span>
|
<span>{{ travel.ref }} - {{ travel.id }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #header-right>
|
<template #header-right>
|
||||||
<QBtn color="white" dense flat icon="more_vert" round size="md">
|
<QBtn color="white" dense flat icon="more_vert" round size="md">
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
|
|
|
@ -6,6 +6,7 @@ export default {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'suppliers',
|
title: 'suppliers',
|
||||||
icon: 'vn:supplier',
|
icon: 'vn:supplier',
|
||||||
|
moduleName: 'Supplier',
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'SupplierMain' },
|
redirect: { name: 'SupplierMain' },
|
||||||
|
|
|
@ -6,6 +6,7 @@ export default {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'claims',
|
title: 'claims',
|
||||||
icon: 'vn:claims',
|
icon: 'vn:claims',
|
||||||
|
moduleName: 'Claim',
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'ClaimMain' },
|
redirect: { name: 'ClaimMain' },
|
||||||
|
|
|
@ -6,6 +6,7 @@ export default {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'customers',
|
title: 'customers',
|
||||||
icon: 'vn:client',
|
icon: 'vn:client',
|
||||||
|
moduleName: 'Customer',
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'CustomerMain' },
|
redirect: { name: 'CustomerMain' },
|
||||||
|
|
|
@ -6,6 +6,7 @@ export default {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'entries',
|
title: 'entries',
|
||||||
icon: 'vn:entry',
|
icon: 'vn:entry',
|
||||||
|
moduleName: 'Entry',
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'EntryMain' },
|
redirect: { name: 'EntryMain' },
|
||||||
|
|
|
@ -6,6 +6,7 @@ export default {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'invoiceIns',
|
title: 'invoiceIns',
|
||||||
icon: 'vn:invoice-in',
|
icon: 'vn:invoice-in',
|
||||||
|
moduleName: 'InvoiceIn',
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'InvoiceInMain' },
|
redirect: { name: 'InvoiceInMain' },
|
||||||
|
|
|
@ -6,6 +6,7 @@ export default {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'invoiceOuts',
|
title: 'invoiceOuts',
|
||||||
icon: 'vn:invoice-out',
|
icon: 'vn:invoice-out',
|
||||||
|
moduleName: 'InvoiceOut',
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'InvoiceOutMain' },
|
redirect: { name: 'InvoiceOutMain' },
|
||||||
|
|
|
@ -6,6 +6,7 @@ export default {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'order',
|
title: 'order',
|
||||||
icon: 'vn:basket',
|
icon: 'vn:basket',
|
||||||
|
moduleName: 'Order',
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'OrderMain' },
|
redirect: { name: 'OrderMain' },
|
||||||
|
|
|
@ -6,6 +6,7 @@ export default {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'routes',
|
title: 'routes',
|
||||||
icon: 'vn:delivery',
|
icon: 'vn:delivery',
|
||||||
|
moduleName: 'Route',
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'RouteMain' },
|
redirect: { name: 'RouteMain' },
|
||||||
|
|
|
@ -1,17 +1,18 @@
|
||||||
import {RouterView} from "vue-router";
|
import { RouterView } from 'vue-router';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: '/shelving',
|
path: '/shelving',
|
||||||
name: 'Shelving',
|
name: 'Shelving',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'shelving',
|
title: 'shelving',
|
||||||
icon: 'vn:inventory'
|
icon: 'vn:inventory',
|
||||||
|
moduleName: 'Shelving',
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'ShelvingMain' },
|
redirect: { name: 'ShelvingMain' },
|
||||||
menus: {
|
menus: {
|
||||||
main: ['ShelvingList'],
|
main: ['ShelvingList'],
|
||||||
card: ['ShelvingBasicData', 'ShelvingLog']
|
card: ['ShelvingBasicData', 'ShelvingLog'],
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
@ -51,8 +52,7 @@ export default {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'summary',
|
title: 'summary',
|
||||||
},
|
},
|
||||||
component: () =>
|
component: () => import('pages/Shelving/Card/ShelvingSummary.vue'),
|
||||||
import('pages/Shelving/Card/ShelvingSummary.vue'),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'ShelvingBasicData',
|
name: 'ShelvingBasicData',
|
||||||
|
@ -75,6 +75,5 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ export default {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'tickets',
|
title: 'tickets',
|
||||||
icon: 'vn:ticket',
|
icon: 'vn:ticket',
|
||||||
|
moduleName: 'Ticket',
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'TicketMain' },
|
redirect: { name: 'TicketMain' },
|
||||||
|
|
|
@ -6,6 +6,7 @@ export default {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'travel',
|
title: 'travel',
|
||||||
icon: 'local_airport',
|
icon: 'local_airport',
|
||||||
|
moduleName: 'Travel',
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'TravelMain' },
|
redirect: { name: 'TravelMain' },
|
||||||
|
|
|
@ -6,6 +6,7 @@ export default {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'wagons',
|
title: 'wagons',
|
||||||
icon: 'vn:trolley',
|
icon: 'vn:trolley',
|
||||||
|
moduleName: 'Wagon',
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'WagonMain' },
|
redirect: { name: 'WagonMain' },
|
||||||
|
|
|
@ -6,6 +6,7 @@ export default {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'workers',
|
title: 'workers',
|
||||||
icon: 'vn:worker',
|
icon: 'vn:worker',
|
||||||
|
moduleName: 'Worker',
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'WorkerMain' },
|
redirect: { name: 'WorkerMain' },
|
||||||
|
|
Loading…
Reference in New Issue