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 {
const body = $props.mapper ? $props.mapper(formData.value) : formData.value;
let response
let response;
if ($props.urlCreate) {
response = await axios.post($props.urlCreate, body);
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>
<div id="row">
<div id="row" class="q-gutter-md">
<slot></slot>
</div>
</template>
<style lang="scss" scopped>
#row {
display: grid;
grid-template-columns: 1fr 1fr;
}
@media screen and (max-width: 800px) {
#row {
flex-direction: column;
grid-template-columns: 1fr;
}
}
</style>

View File

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

View File

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

View File

@ -64,6 +64,9 @@ export default {
markAll: 'Marcar todo',
noResults: 'Sin resultados',
system: 'Sistema',
warehouse: 'Almacén',
company: 'Empresa',
type: 'Tipo',
},
errors: {
statusUnauthorized: 'Acceso denegado',
@ -264,6 +267,7 @@ export default {
basicData: 'Datos básicos',
buys: 'Compras',
notes: 'Notas',
dms: 'Gestión documental',
log: 'Historial',
},
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' },
menus: {
main: ['EntryList'],
card: ['EntryBasicData', 'EntryBuys', 'EntryNotes', 'EntryLog'],
card: ['EntryBasicData', 'EntryBuys', 'EntryNotes', 'EntryDms', 'EntryLog'],
},
children: [
{
@ -86,6 +86,15 @@ export default {
},
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',
name: 'EntryLog',