refs #5509 feat: VnDms feat: EntryDms
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2024-01-29 15:12:30 +01:00
parent f715c615d2
commit 5b6a526932
8 changed files with 107 additions and 5 deletions

View File

@ -128,7 +128,7 @@ async function save() {
try { try {
const body = $props.mapper ? $props.mapper(formData.value) : formData.value; const body = $props.mapper ? $props.mapper(formData.value) : formData.value;
let response let response;
if ($props.urlCreate) { if ($props.urlCreate) {
response = await axios.post($props.urlCreate, body); response = await axios.post($props.urlCreate, body);
notify('globals.dataCreated', 'positive'); notify('globals.dataCreated', 'positive');

View File

@ -0,0 +1,75 @@
<script setup>
import { ref } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import FetchData from 'components/FetchData.vue';
import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
import VnInput from 'src/components/common/VnInput.vue';
const route = useRoute();
const { t } = useI18n();
const warehouses = ref();
const companies = ref();
const dmsTypes = ref();
</script>
<template>
<FetchData url="Warehouses" @on-fetch="(data) => (warehouses = data)" auto-load />
<FetchData url="Companies" @on-fetch="(data) => (companies = data)" auto-load />
<FetchData url="DmsTypes" @on-fetch="(data) => (dmsTypes = data)" auto-load />
<FormModel
:url="`Dms/${route.params.id}`"
:url-update="`Claims/updateClaim/${route.params.id}`"
model="dms"
>
<template #form="{ data }">
<div class="q-gutter-y-ms">
<VnRow>
<VnInput :label="t('Reference')" v-model="data.reference" />
<VnSelectFilter
:label="t('globals.company')"
v-model="data.companyFk"
:options="companies"
option-value="id"
option-label="code"
input-debounce="0"
/>
</VnRow>
<VnRow>
<VnSelectFilter
:label="t('globals.warehouse')"
v-model="data.warehouseFk"
:options="warehouses"
option-value="id"
option-label="name"
input-debounce="0"
/>
<VnSelectFilter
:label="t('globals.type')"
v-model="data.dmsTypeFk"
:options="dmsTypes"
option-value="id"
option-label="name"
input-debounce="0"
/>
</VnRow>
<VnRow>
<QInput
:label="t('globals.description')"
v-model="data.description"
type="textarea"
/>
</VnRow>
</div>
</template>
</FormModel>
</template>
<style scoped>
.q-gutter-y-ms {
display: grid;
row-gap: 20px;
}
</style>

View File

@ -1,12 +1,16 @@
<template> <template>
<div id="row"> <div id="row" class="q-gutter-md">
<slot></slot> <slot></slot>
</div> </div>
</template> </template>
<style lang="scss" scopped> <style lang="scss" scopped>
#row {
display: grid;
grid-template-columns: 1fr 1fr;
}
@media screen and (max-width: 800px) { @media screen and (max-width: 800px) {
#row { #row {
flex-direction: column; grid-template-columns: 1fr;
} }
} }
</style> </style>

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { onMounted, onUnmounted, ref } from 'vue'; import { onMounted, onUnmounted } from 'vue';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
const stateStore = useStateStore(); const stateStore = useStateStore();

View File

@ -64,6 +64,9 @@ export default {
markAll: 'Mark all', markAll: 'Mark all',
noResults: 'No results', noResults: 'No results',
system: 'System', system: 'System',
warehouse: 'Warehouse',
company: 'Company',
type: 'Type',
}, },
errors: { errors: {
statusUnauthorized: 'Access denied', statusUnauthorized: 'Access denied',
@ -265,6 +268,7 @@ export default {
basicData: 'Basic data', basicData: 'Basic data',
buys: 'Buys', buys: 'Buys',
notes: 'Notes', notes: 'Notes',
dms: 'File management',
log: 'Log', log: 'Log',
}, },
list: { list: {

View File

@ -64,6 +64,9 @@ export default {
markAll: 'Marcar todo', markAll: 'Marcar todo',
noResults: 'Sin resultados', noResults: 'Sin resultados',
system: 'Sistema', system: 'Sistema',
warehouse: 'Almacén',
company: 'Empresa',
type: 'Tipo',
}, },
errors: { errors: {
statusUnauthorized: 'Acceso denegado', statusUnauthorized: 'Acceso denegado',
@ -264,6 +267,7 @@ export default {
basicData: 'Datos básicos', basicData: 'Datos básicos',
buys: 'Compras', buys: 'Compras',
notes: 'Notas', notes: 'Notas',
dms: 'Gestión documental',
log: 'Historial', log: 'Historial',
}, },
list: { list: {

View File

@ -0,0 +1,6 @@
<script setup>
import VnDms from 'src/components/common/VnDms.vue';
</script>
<template>
<VnDms model="Entry" />
</template>

View File

@ -11,7 +11,7 @@ export default {
redirect: { name: 'EntryMain' }, redirect: { name: 'EntryMain' },
menus: { menus: {
main: ['EntryList'], main: ['EntryList'],
card: ['EntryBasicData', 'EntryBuys', 'EntryNotes', 'EntryLog'], card: ['EntryBasicData', 'EntryBuys', 'EntryNotes', 'EntryDms', 'EntryLog'],
}, },
children: [ children: [
{ {
@ -86,6 +86,15 @@ export default {
}, },
component: () => import('src/pages/Entry/Card/EntryNotes.vue'), component: () => import('src/pages/Entry/Card/EntryNotes.vue'),
}, },
{
path: 'dms',
name: 'EntryDms',
meta: {
title: 'dms',
icon: 'cloud_upload',
},
component: () => import('src/pages/Entry/Card/EntryDms.vue'),
},
{ {
path: 'log', path: 'log',
name: 'EntryLog', name: 'EntryLog',