#6243 generalize cmr section #349

Merged
jorgep merged 10 commits from 6243-generalizeCmrSection into dev 2024-06-11 07:36:39 +00:00
5 changed files with 39 additions and 11 deletions

View File

@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- (Item) => Se añade la opción de añadir un comentario del motivo de hacer una foto
- (Worker) => Se añade la opción de crear un trabajador ajeno a la empresa
- (Route) => Ahora se muestran todos los cmrs
## [2418.01]

View File

@ -962,7 +962,7 @@ roadmap:
route:
pageTitles:
routes: Routes
cmrsList: External CMRs list
cmrsList: CMRs list
RouteList: List
routeCreate: New route
basicData: Basic Data

View File

@ -950,7 +950,7 @@ roadmap:
route:
pageTitles:
routes: Rutas
cmrsList: Listado de CMRs externos
cmrsList: Listado de CMRs
RouteList: Listado
routeCreate: Nueva ruta
basicData: Datos básicos

View File

@ -1,11 +1,11 @@
<script setup>
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import FetchData from 'components/FetchData.vue';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
const { t } = useI18n();
const props = defineProps({
@ -16,10 +16,11 @@ const props = defineProps({
});
const countries = ref();
const warehouses = ref();
</script>
<template>
<FetchData url="Countries" @on-fetch="(data) => (countries = data)" auto-load />
<FetchData url="Warehouses" @on-fetch="(data) => (warehouses = data)" auto-load />
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
@ -93,13 +94,13 @@ const countries = ref();
<QItemSection v-if="!countries">
<QSkeleton type="QInput" class="full-width" />
</QItemSection>
<QItemSection v-if="countries" class="q-mb-sm">
<QSelect
<QItemSection v-if="countries">
<VnSelect
:label="t('route.cmr.list.country')"
v-model="params.country"
:options="countries"
option-value="country"
option-label="country"
option-label="name"
option-value="id"
transition-show="jump-down"
transition-hide="jump-up"
emit-value
@ -111,9 +112,23 @@ const countries = ref();
<template #prepend>
<QIcon name="flag" size="sm"></QIcon>
</template>
</QSelect>
</VnSelect>
</QItemSection>
</QItem>
<QItem>
<VnSelect
:label="t('globals.warehouse')"
:options="warehouses"
hide-selected
option-label="name"
option-value="id"
v-model="params.warehouseFk"
rounded
dense
outlined
>
</VnSelect>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
@ -126,7 +141,6 @@ const countries = ref();
</template>
</VnFilterPanel>
</template>
<i18n>
en:
params:

View File

@ -14,6 +14,7 @@ const { t } = useI18n();
const { getTokenMultimedia } = useSession();
const token = getTokenMultimedia();
const selected = ref([]);
const warehouses = ref([]);
const columns = computed(() => [
{
@ -63,6 +64,13 @@ const columns = computed(() => [
sortable: true,
headerStyle: 'padding-left: 33px',
},
{
name: 'warehouseFk',
label: t('globals.warehouse'),
field: ({ warehouseFk }) => warehouseFk,
align: 'center',
sortable: true,
},
{
name: 'icons',
align: 'center',
@ -99,7 +107,7 @@ function downloadPdfs() {
<div class="list">
<VnPaginate
data-key="CmrList"
:url="`Routes/getExternalCmrs`"
:url="`Routes/cmrs`"
order="cmrFk DESC"
limit="null"
auto-load
@ -147,6 +155,11 @@ function downloadPdfs() {
<CustomerDescriptorProxy :id="value" />
</QTd>
</template>
<template #body-cell-warehouseFk="{ value }">
<QTd align="center">
{{ warehouses.find(({ id }) => id === value)?.name }}
</QTd>
</template>
<template #body-cell-icons="{ value }">
<QTd align="center">
<a :href="getCmrUrl(value)" target="_blank">