0
0
Fork 0

Merge branch 'dev' into 7553_FixTicketExpedition

This commit is contained in:
Jon Elias 2024-09-24 08:36:57 +00:00
commit 21f7613f21
24 changed files with 277 additions and 201 deletions

View File

@ -428,7 +428,7 @@ function handleOnDataSaved(_) {
<QBtn <QBtn
v-if="$props.rightSearch" v-if="$props.rightSearch"
icon="filter_alt" icon="filter_alt"
class="bg-vn-section-color q-ml-md" class="bg-vn-section-color q-ml-sm"
dense dense
@click="stateStore.toggleRightDrawer()" @click="stateStore.toggleRightDrawer()"
/> />
@ -515,8 +515,12 @@ function handleOnDataSaved(_) {
:key="index" :key="index"
:title="btn.title" :title="btn.title"
:icon="btn.icon" :icon="btn.icon"
class="q-px-sm text-primary-light" class="q-pa-xs"
flat flat
dense
:class="
btn.isPrimary ? 'text-primary-light' : 'color-vn-text '
"
:style="`visibility: ${ :style="`visibility: ${
(btn.show && btn.show(row)) ?? true ? 'visible' : 'hidden' (btn.show && btn.show(row)) ?? true ? 'visible' : 'hidden'
}`" }`"
@ -670,18 +674,10 @@ function handleOnDataSaved(_) {
:key="col?.id" :key="col?.id"
class="text-center" class="text-center"
> >
<div <slot
v-if="col?.summation" :name="`column-footer-${col.name}`"
:class="`text-${col?.align ?? 'left'}`" :class="getColAlign(col)"
class="text-bold q-pa-sm" />
>
{{
rows.reduce(
(sum, currentRow) => sum + currentRow[col.name],
0
)
}}
</div>
</QTh> </QTh>
</QTr> </QTr>
</template> </template>
@ -766,10 +762,6 @@ es:
border-color: var(--vn-section-color); border-color: var(--vn-section-color);
} }
.q-table__container > div:first-child {
background-color: var(--vn-page-color);
}
.grid-three { .grid-three {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(400px, max-content)); grid-template-columns: repeat(auto-fit, minmax(400px, max-content));
@ -798,10 +790,16 @@ es:
} }
} }
.q-table th { .q-table {
padding: 0; th {
} padding: 0;
}
&__top {
padding: 12px 0px;
top: 0;
}
}
.vnTable { .vnTable {
thead tr th { thead tr th {
position: sticky; position: sticky;

View File

@ -135,7 +135,7 @@ onMounted(async () => {
}); });
</script> </script>
<template> <template>
<QBtn icon="vn:visible_columns" class="bg-vn-section-color q-mr-md q-px-sm" dense> <QBtn icon="vn:visible_columns" class="bg-vn-section-color q-mr-sm q-px-sm" dense>
<QPopupProxy ref="popupProxyRef"> <QPopupProxy ref="popupProxyRef">
<QCard class="column q-pa-md"> <QCard class="column q-pa-md">
<QIcon name="info" size="sm" class="info-icon"> <QIcon name="info" size="sm" class="info-icon">

View File

@ -14,11 +14,11 @@ const props = defineProps({
}); });
const modelValue = ref( const modelValue = ref(
props.location props.location
? `${props.location?.postcode} - ${props.location?.city}(${props.location?.province?.name}), ${props.location?.country?.name}` ? `${props.location?.postcode}, ${props.location?.city}(${props.location?.province?.name}), ${props.location?.country?.name}`
: null : null
); );
function showLabel(data) { function showLabel(data) {
return `${data.code} - ${data.town}(${data.province}), ${data.country}`; return `${data.code}, ${data.town}(${data.province}), ${data.country}`;
} }
const handleModelValue = (data) => { const handleModelValue = (data) => {
emit('update:model-value', data); emit('update:model-value', data);

View File

@ -131,9 +131,8 @@ async function fetch(params) {
useArrayData(props.dataKey, params); useArrayData(props.dataKey, params);
arrayData.reset(['filter.skip', 'skip']); arrayData.reset(['filter.skip', 'skip']);
await arrayData.fetch({ append: false }); await arrayData.fetch({ append: false });
if (!store.hasMoreData) { if (!store.hasMoreData) isLoading.value = false;
isLoading.value = false;
}
emit('onFetch', store.data); emit('onFetch', store.data);
return store.data; return store.data;
} }

View File

@ -36,7 +36,6 @@ $color-font-secondary: #777;
.bg-success { .bg-success {
background-color: $positive; background-color: $positive;
} }
.bg-notice { .bg-notice {
background-color: $info; background-color: $info;
} }

View File

@ -908,6 +908,7 @@ supplier:
account: Account account: Account
payMethod: Pay Method payMethod: Pay Method
payDay: Pay Day payDay: Pay Day
country: Country
summary: summary:
responsible: Responsible responsible: Responsible
notes: Notes notes: Notes

View File

@ -162,6 +162,7 @@ globals:
dms: Gestión documental dms: Gestión documental
entryCreate: Nueva entrada entryCreate: Nueva entrada
latestBuys: Últimas compras latestBuys: Últimas compras
reserves: Reservas
tickets: Tickets tickets: Tickets
ticketCreate: Nuevo ticket ticketCreate: Nuevo ticket
boxing: Encajado boxing: Encajado
@ -892,6 +893,7 @@ supplier:
account: Cuenta account: Cuenta
payMethod: Método de pago payMethod: Método de pago
payDay: Dia de pago payDay: Dia de pago
country: País
summary: summary:
responsible: Responsable responsible: Responsable
notes: Notas notes: Notas

View File

@ -111,6 +111,8 @@ const exprBuilder = (param, value) => {
}" }"
:fields="['id', 'nickname']" :fields="['id', 'nickname']"
sort-by="nickname ASC" sort-by="nickname ASC"
option-label="nickname"
option-value="id"
:rules="validate('client.salesPersonFk')" :rules="validate('client.salesPersonFk')"
:expr-builder="exprBuilder" :expr-builder="exprBuilder"
emit-value emit-value

View File

@ -429,6 +429,8 @@ function handleLocation(data, location) {
:params="{ :params="{
departmentCodes: ['VT', 'shopping'], departmentCodes: ['VT', 'shopping'],
}" }"
option-label="nickname"
option-value="id"
:fields="['id', 'nickname']" :fields="['id', 'nickname']"
sort-by="nickname ASC" sort-by="nickname ASC"
emit-value emit-value

View File

@ -10,6 +10,7 @@ import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.v
import { toDate, toCurrency } from 'src/filters'; import { toDate, toCurrency } from 'src/filters';
import { getUrl } from 'src/composables/getUrl'; import { getUrl } from 'src/composables/getUrl';
import axios from 'axios'; import axios from 'axios';
import FetchedTags from 'src/components/ui/FetchedTags.vue';
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
@ -163,7 +164,7 @@ const fetchEntryBuys = async () => {
> >
<template #header-left> <template #header-left>
<router-link <router-link
v-if="route.name !== 'EntrySummary'" v-if="route?.name !== 'EntrySummary'"
:to="{ name: 'EntrySummary', params: { id: entityId } }" :to="{ name: 'EntrySummary', params: { id: entityId } }"
class="header link" class="header link"
:href="entryUrl" :href="entryUrl"
@ -184,7 +185,10 @@ const fetchEntryBuys = async () => {
<QIcon name="open_in_new" /> <QIcon name="open_in_new" />
</router-link> </router-link>
<VnLv :label="t('entry.summary.commission')" :value="entry.commission" /> <VnLv :label="t('entry.summary.commission')" :value="entry.commission" />
<VnLv :label="t('entry.summary.currency')" :value="entry.currency.name" /> <VnLv
:label="t('entry.summary.currency')"
:value="entry.currency?.name"
/>
<VnLv :label="t('entry.summary.company')" :value="entry.company.code" /> <VnLv :label="t('entry.summary.company')" :value="entry.company.code" />
<VnLv :label="t('entry.summary.reference')" :value="entry.reference" /> <VnLv :label="t('entry.summary.reference')" :value="entry.reference" />
<VnLv <VnLv
@ -210,12 +214,12 @@ const fetchEntryBuys = async () => {
</VnLv> </VnLv>
<VnLv <VnLv
:label="t('entry.summary.travelAgency')" :label="t('entry.summary.travelAgency')"
:value="entry.travel.agency.name" :value="entry.travel.agency?.name"
/> />
<VnLv :label="t('shipped')" :value="toDate(entry.travel.shipped)" /> <VnLv :label="t('shipped')" :value="toDate(entry.travel.shipped)" />
<VnLv <VnLv
:label="t('entry.summary.travelWarehouseOut')" :label="t('entry.summary.travelWarehouseOut')"
:value="entry.travel.warehouseOut.name" :value="entry.travel.warehouseOut?.name"
/> />
<QCheckbox <QCheckbox
:label="t('entry.summary.travelDelivered')" :label="t('entry.summary.travelDelivered')"
@ -225,7 +229,7 @@ const fetchEntryBuys = async () => {
<VnLv :label="t('landed')" :value="toDate(entry.travel.landed)" /> <VnLv :label="t('landed')" :value="toDate(entry.travel.landed)" />
<VnLv <VnLv
:label="t('entry.summary.travelWarehouseIn')" :label="t('entry.summary.travelWarehouseIn')"
:value="entry.travel.warehouseIn.name" :value="entry.travel.warehouseIn?.name"
/> />
<QCheckbox <QCheckbox
:label="t('entry.summary.travelReceived')" :label="t('entry.summary.travelReceived')"
@ -281,17 +285,17 @@ const fetchEntryBuys = async () => {
> >
<template #body="{ cols, row, rowIndex }"> <template #body="{ cols, row, rowIndex }">
<QTr no-hover> <QTr no-hover>
<QTd v-for="col in cols" :key="col.name"> <QTd v-for="col in cols" :key="col?.name">
<component <component
:is="tableColumnComponents[col.name].component(props)" :is="tableColumnComponents[col?.name].component()"
v-bind="tableColumnComponents[col.name].props(props)" v-bind="tableColumnComponents[col?.name].props()"
@click="tableColumnComponents[col.name].event(props)" @click="tableColumnComponents[col?.name].event()"
class="col-content" class="col-content"
> >
<template <template
v-if=" v-if="
col.name !== 'observation' && col?.name !== 'observation' &&
col.name !== 'isConfirmed' col?.name !== 'isConfirmed'
" "
>{{ col.value }}</template >{{ col.value }}</template
> >

View File

@ -1,16 +1,17 @@
<script setup> <script setup>
import { onMounted, onUnmounted, ref } from 'vue'; import { onMounted, onUnmounted, ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import RightMenu from 'src/components/common/RightMenu.vue';
import VnTable from 'components/VnTable/VnTable.vue';
import EntryLatestBuysFilter from './EntryLatestBuysFilter.vue';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { toDate } from 'src/filters';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import EntryLatestBuysFilter from './EntryLatestBuysFilter.vue';
import VnTable from 'components/VnTable/VnTable.vue';
import VnImg from 'src/components/ui/VnImg.vue';
const stateStore = useStateStore(); const stateStore = useStateStore();
const { t } = useI18n(); const { t } = useI18n();
import { toDate } from 'src/filters';
import VnImg from 'src/components/ui/VnImg.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
const columns = [ const columns = [
{ {
align: 'center', align: 'center',

View File

@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue'; import VnInputDate from 'src/components/common/VnInputDate.vue';
import VnInput from 'components/common/VnInput.vue';
import VnSelect from 'components/common/VnSelect.vue'; import VnSelect from 'components/common/VnSelect.vue';
import ItemsFilterPanel from 'src/components/ItemsFilterPanel.vue'; import ItemsFilterPanel from 'src/components/ItemsFilterPanel.vue';
@ -18,6 +19,7 @@ defineProps({
const itemTypeWorkersOptions = ref([]); const itemTypeWorkersOptions = ref([]);
const suppliersOptions = ref([]); const suppliersOptions = ref([]);
const tagValues = ref([]);
</script> </script>
<template> <template>

View File

@ -54,10 +54,9 @@ const columns = [
create: true, create: true,
component: 'number', component: 'number',
summation: true, summation: true,
cardVisible: true,
}, },
{ {
align: 'left', align: 'center',
label: t('Bought'), label: t('Bought'),
name: 'bought', name: 'bought',
summation: true, summation: true,
@ -101,14 +100,9 @@ const travel = ref(null);
const userParams = ref({ const userParams = ref({
dated: Date.vnNew(), dated: Date.vnNew(),
}); });
const filter = ref({ const filter = ref({
where: { fields: ['id', 'm3', 'warehouseInFk'],
shipped: (userParams.value.dated
? new Date(userParams.value.dated)
: Date.vnNew()
).setHours(0, 0, 0, 0),
m3: { neq: null },
},
include: [ include: [
{ {
relation: 'warehouseIn', relation: 'warehouseIn',
@ -117,6 +111,13 @@ const filter = ref({
}, },
}, },
], ],
where: {
shipped: (userParams.value.dated
? new Date(userParams.value.dated)
: Date.vnNew()
).setHours(0, 0, 0, 0),
m3: { neq: null },
},
}); });
const setUserParams = async ({ dated }) => { const setUserParams = async ({ dated }) => {
@ -128,6 +129,18 @@ const setUserParams = async ({ dated }) => {
function openDialog() { function openDialog() {
travelDialogRef.value = true; travelDialogRef.value = true;
} }
function setFooter(data) {
const footer = {
bought: 0,
reserve: 0,
};
data.forEach((row) => {
footer.bought += row?.bought;
footer.reserve += row?.reserve;
});
tableRef.value.footer = footer;
}
</script> </script>
<template> <template>
<VnSubToolbar> <VnSubToolbar>
@ -139,7 +152,7 @@ function openDialog() {
:filter="filter" :filter="filter"
@on-fetch=" @on-fetch="
(data) => { (data) => {
travel = data.filter((data) => data.warehouseIn.code === 'VNH'); travel = data.find((data) => data.warehouseIn.code === 'VNH');
} }
" "
/> />
@ -149,10 +162,10 @@ function openDialog() {
{{ t('Booked trucks') }}: {{ t('Booked trucks') }}:
</span> </span>
<span> <span>
{{ travel[0]?.m3 }} {{ travel?.m3 }}
</span> </span>
<QBtn <QBtn
v-if="travel[0]?.m3" v-if="travel?.m3"
style="max-width: 20%" style="max-width: 20%"
flat flat
icon="edit" icon="edit"
@ -166,10 +179,10 @@ function openDialog() {
</VnSubToolbar> </VnSubToolbar>
<QDialog v-model="travelDialogRef" :maximized="true" :class="['vn-row', 'wrap']"> <QDialog v-model="travelDialogRef" :maximized="true" :class="['vn-row', 'wrap']">
<FormModelPopup <FormModelPopup
:url-update="`Travels/${travel[0].id}`" :url-update="`Travels/${travel?.id}`"
model="travel" model="travel"
:title="t('Travel m3')" :title="t('Travel m3')"
:form-initial-data="{ id: travel[0].id, m3: travel[0].m3 }" :form-initial-data="{ id: travel?.id, m3: travel?.m3 }"
@on-data-saved="fetchDataRef.fetch()" @on-data-saved="fetchDataRef.fetch()"
> >
<template #form-inputs="{ data }"> <template #form-inputs="{ data }">
@ -192,51 +205,80 @@ function openDialog() {
/> />
</template> </template>
</RightMenu> </RightMenu>
<QPage class="column items-center q-pa-md"> <div class="table-container">
<VnTable <QPage class="column items-center q-pa-md">
ref="tableRef" <VnTable
data-key="StockBoughts" ref="tableRef"
url="StockBoughts/getStockBought" data-key="StockBoughts"
save-url="StockBoughts/crud" url="StockBoughts/getStockBought"
order="reserve DESC" save-url="StockBoughts/crud"
:right-search="false" order="reserve DESC"
:is-editable="true" :right-search="false"
:create="{ :is-editable="true"
urlCreate: 'StockBoughts', @on-fetch="(data) => setFooter(data)"
title: t('Reserve some space'), :create="{
onDataSaved: () => tableRef.reload(), urlCreate: 'StockBoughts',
formInitialData: { title: t('Reserve some space'),
workerFk: user.id, onDataSaved: () => tableRef.reload(),
dated: Date.vnNow(), formInitialData: {
}, workerFk: user.id,
}" dated: Date.vnNow(),
:columns="columns" },
:user-params="userParams" }"
:footer="true" :columns="columns"
auto-load :user-params="userParams"
> :footer="true"
<template #column-workerFk="{ row }"> auto-load
<span class="link" @click.stop> >
{{ row?.worker?.user?.name }} <template #column-workerFk="{ row }">
<WorkerDescriptorProxy :id="row?.workerFk" /> <span class="link" @click.stop>
</span> {{ row?.worker?.user?.name }}
</template> <WorkerDescriptorProxy :id="row?.workerFk" />
</VnTable> </span>
</QPage> </template>
<template #column-bought="{ row }">
<span :class="{ 'text-negative': row.reserve < row.bought }">
{{ row?.bought }}
</span>
</template>
<template #column-footer-reserve>
<span>
{{ tableRef.footer.reserve }}
</span>
</template>
<template #column-footer-bought>
<span
:class="{
'text-negative':
tableRef.footer.reserve < tableRef.footer.bought,
}"
>
{{ tableRef.footer.bought }}
</span>
</template>
</VnTable>
</QPage>
</div>
</template> </template>
<style lang="css" scoped> <style lang="scss" scoped>
.travel { .travel {
margin-bottom: 0px; margin-bottom: 0px;
} }
.table-container {
display: flex;
justify-content: center;
}
.column {
display: flex;
flex-direction: column;
align-items: center;
width: 40%;
}
.text-negative {
color: $negative !important;
}
</style> </style>
<i18n> <i18n>
en:
Buyer: Buyer
Reserve: Reserve
Bought: Bought
More: More
Date: Date
This buyer has already made a reservation for this date: This buyer has already made a reservation for this date
es: es:
Edit travel: Editar envío Edit travel: Editar envío
Travel: Envíos Travel: Envíos

View File

@ -22,7 +22,7 @@ const customUrl = `StockBoughts/getStockBoughtDetail?workerFk=${$props.workerFk}
const columns = [ const columns = [
{ {
align: 'left', align: 'left',
label: 'Entry', label: t('Entry'),
name: 'entryFk', name: 'entryFk',
isTitle: true, isTitle: true,
isId: true, isId: true,
@ -41,29 +41,33 @@ const columns = [
create: true, create: true,
columnClass: 'expand', columnClass: 'expand',
columnFilter: false, columnFilter: false,
cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
name: 'volume', name: 'volume',
label: t('Volume'), label: t('Volume'),
columnFilter: false, columnFilter: false,
cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
label: t('Packaging'), label: t('Packaging'),
name: 'packagingFk', name: 'packagingFk',
columnFilter: false, columnFilter: false,
cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
label: 'Packing', label: 'Packing',
name: 'packing', name: 'packing',
columnFilter: false, columnFilter: false,
cardVisible: true,
}, },
]; ];
</script> </script>
<template> <template>
<QDialog :maximized="true"> <QDialog>
<div class="container"> <div class="container">
<VnTable <VnTable
ref="tableRef" ref="tableRef"
@ -73,18 +77,26 @@ const columns = [
:columns="columns" :columns="columns"
:right-search="false" :right-search="false"
:disable-infinite-scroll="true" :disable-infinite-scroll="true"
:disable-option="{ card: true }"
:limit="0" :limit="0"
auto-load auto-load
> >
<template #top-left>
<QBtn
flat
icon="Close"
color="primary"
class="bg-vn-section-color q-pa-xs"
v-close-popup
/>
</template>
<template #column-entryFk="{ row }"> <template #column-entryFk="{ row }">
<span class="link" @click.stop> <span class="link">
{{ row?.entryFk }} {{ row?.entryFk }}
<EntryDescriptorProxy :id="row.entryFk" /> <EntryDescriptorProxy :id="row.entryFk" />
</span> </span>
</template> </template>
<template #column-itemName="{ row }"> <template #column-itemName="{ row }">
<span class="link" @click.stop> <span class="link">
{{ row?.itemName }} {{ row?.itemName }}
<ItemDescriptorProxy :id="row.itemFk" /> <ItemDescriptorProxy :id="row.itemFk" />
</span> </span>
@ -93,11 +105,10 @@ const columns = [
</div> </div>
</QDialog> </QDialog>
</template> </template>
<style lang="css"> <style lang="css" scoped>
.q-dialog__inner { .container {
max-width: 50vw; max-width: 50vw;
overflow: auto; overflow: auto;
display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin: auto; margin: auto;
@ -110,4 +121,9 @@ const columns = [
Bought: Comprado Bought: Comprado
More: Más More: Más
Date: Fecha Date: Fecha
Entry: Entrada
Item: Artículo
Name: Nombre
Volume: Volumen
Packaging: Embalage
</i18n> </i18n>

View File

@ -139,7 +139,11 @@ const columns = computed(() => [
</VnTable> </VnTable>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.full-width .vn-row > * { .full-width .vn-row {
flex: 0.4; margin-bottom: 0;
flex-direction: row;
> * {
max-width: 125px;
}
} }
</style> </style>

View File

@ -132,7 +132,6 @@ const openTab = (id) =>
:table="{ :table="{
'row-key': 'id', 'row-key': 'id',
selection: 'multiple', selection: 'multiple',
'hide-bottom': true,
}" }"
default-mode="table" default-mode="table"
:row-click="({ id }) => openTab(id)" :row-click="({ id }) => openTab(id)"

View File

@ -54,7 +54,6 @@ const columns = computed(() => [
label: t('salesTicketsTable.problems'), label: t('salesTicketsTable.problems'),
name: 'totalProblems', name: 'totalProblems',
align: 'left', align: 'left',
columnFilter: false, columnFilter: false,
attrs: { attrs: {
dense: true, dense: true,
@ -65,7 +64,6 @@ const columns = computed(() => [
name: 'id', name: 'id',
field: 'id', field: 'id',
align: 'left', align: 'left',
columnFilter: { columnFilter: {
component: 'number', component: 'number',
name: 'id', name: 'id',
@ -108,9 +106,7 @@ const columns = computed(() => [
{ {
label: t('salesTicketsTable.date'), label: t('salesTicketsTable.date'),
name: 'shippedDate', name: 'shippedDate',
style: { 'max-width': '100px' },
align: 'left', align: 'left',
columnFilter: { columnFilter: {
component: 'date', component: 'date',
name: 'shippedDate', name: 'shippedDate',
@ -164,7 +160,6 @@ const columns = computed(() => [
label: t('salesTicketsTable.state'), label: t('salesTicketsTable.state'),
name: 'state', name: 'state',
align: 'left', align: 'left',
style: { 'max-width': '100px' },
columnFilter: { columnFilter: {
component: 'select', component: 'select',
name: 'stateFk', name: 'stateFk',
@ -193,7 +188,6 @@ const columns = computed(() => [
label: t('salesTicketsTable.zone'), label: t('salesTicketsTable.zone'),
name: 'zoneFk', name: 'zoneFk',
align: 'left', align: 'left',
columnFilter: { columnFilter: {
component: 'select', component: 'select',
name: 'zoneFk', name: 'zoneFk',
@ -210,8 +204,6 @@ const columns = computed(() => [
name: 'totalWithVat', name: 'totalWithVat',
field: 'totalWithVat', field: 'totalWithVat',
align: 'left', align: 'left',
style: { 'max-width': '75px' },
columnFilter: { columnFilter: {
component: 'number', component: 'number',
name: 'totalWithVat', name: 'totalWithVat',
@ -370,7 +362,7 @@ const openTab = (id) =>
</QCheckbox> </QCheckbox>
</template> </template>
<template #column-totalProblems="{ row }"> <template #column-totalProblems="{ row }">
<QTd class="no-padding" style="max-width: 60px"> <span>
<QIcon <QIcon
v-if="row.isTaxDataChecked === 0" v-if="row.isTaxDataChecked === 0"
name="vn:no036" name="vn:no036"
@ -424,46 +416,40 @@ const openTab = (id) =>
> >
<QTooltip>{{ $t('salesTicketsTable.tooLittle') }}</QTooltip> <QTooltip>{{ $t('salesTicketsTable.tooLittle') }}</QTooltip>
</QIcon> </QIcon>
</QTd> </span>
</template> </template>
<template #column-id="{ row }"> <template #column-id="{ row }">
<QTd class="no-padding"> <span class="link" @click.stop.prevent>
<span class="link" @click.stop.prevent> {{ row.id }}
{{ row.id }} <TicketDescriptorProxy :id="row.id" />
<TicketDescriptorProxy :id="row.id" /> </span>
</span>
</QTd>
</template> </template>
<template #column-clientFk="{ row }"> <template #column-clientFk="{ row }">
<QTd class="no-padding" @click.stop :title="row.nickname"> <div @click.stop :title="row.nickname">
<span class="link">{{ row.nickname }}</span> <span class="link" v-text="row.nickname" />
<CustomerDescriptorProxy :id="row.clientFk" /> <CustomerDescriptorProxy :id="row.clientFk" />
</QTd> </div>
</template> </template>
<template #column-salesPersonFk="{ row }"> <template #column-salesPersonFk="{ row }">
<QTd class="no-padding" @click.stop :title="row.userName"> <div @click.stop :title="row.userName">
<span class="link" v-text="dashIfEmpty(row.userName)" /> <span class="link" v-text="dashIfEmpty(row.userName)" />
<WorkerDescriptorProxy :id="row.salesPersonFk" /> <WorkerDescriptorProxy :id="row.salesPersonFk" />
</QTd> </div>
</template> </template>
<template #column-shippedDate="{ row }"> <template #column-shippedDate="{ row }">
<QTd class="no-padding"> <QBadge
<QBadge v-bind="getBadgeAttrs(row.shippedDate)"
v-bind="getBadgeAttrs(row.shippedDate)" class="q-pa-sm"
class="q-pa-sm" style="font-size: 14px"
style="font-size: 14px" >
> {{ formatShippedDate(row.shippedDate) }}
{{ formatShippedDate(row.shippedDate) }} </QBadge>
</QBadge>
</QTd>
</template> </template>
<template #column-provinceFk="{ row }"> <template #column-provinceFk="{ row }">
<QTd class="no-padding"> <span :title="row.province" v-text="row.province" />
<span :title="row.province" v-text="row.province" />
</QTd>
</template> </template>
<template #column-state="{ row }"> <template #column-state="{ row }">
<QTd class="no-padding" @click.stop.prevent> <div @click.stop.prevent>
<div v-if="row.refFk"> <div v-if="row.refFk">
<span class="link">{{ row.refFk }}</span> <span class="link">{{ row.refFk }}</span>
<InvoiceOutDescriptorProxy :id="row.invoiceOutId" /> <InvoiceOutDescriptorProxy :id="row.invoiceOutId" />
@ -477,32 +463,33 @@ const openTab = (id) =>
> >
{{ row.state }} {{ row.state }}
</QBadge> </QBadge>
</QTd> </div>
</template> </template>
<template #column-isFragile="{ row }"> <template #column-isFragile="{ row }">
<QTd class="no-padding"> <QIcon v-if="row.isFragile" name="local_bar" color="primary" size="sm">
<QIcon v-if="row.isFragile" name="local_bar" color="primary" size="sm"> <QTooltip>{{ $t('salesTicketsTable.isFragile') }}</QTooltip>
<QTooltip>{{ $t('salesTicketsTable.isFragile') }}</QTooltip> </QIcon>
</QIcon>
</QTd>
</template> </template>
<template #column-zoneFk="{ row }"> <template #column-zoneFk="{ row }">
<QTd class="no-padding" @click.stop.prevent :title="row.zoneName"> <div @click.stop.prevent :title="row.zoneName">
<span class="link">{{ row.zoneName }}</span> <span class="link">{{ row.zoneName }}</span>
<ZoneDescriptorProxy :id="row.zoneFk" /> <ZoneDescriptorProxy :id="row.zoneFk" />
</QTd> </div>
</template> </template>
<template #column-totalWithVat="{ row }"> <template #column-totalWithVat="{ row }">
<QTd class="no-padding"> <QBadge
<QBadge :color="totalPriceColor(row) || 'transparent'"
:color="totalPriceColor(row) || 'transparent'" :text-color="totalPriceColor(row) ? 'black' : 'white'"
:text-color="totalPriceColor(row) ? 'black' : 'white'" class="q-pa-sm"
class="q-pa-sm" style="font-size: 14px"
style="font-size: 14px" >
> {{ toCurrency(row.totalWithVat) }}
{{ toCurrency(row.totalWithVat) }} </QBadge>
</QBadge>
</QTd>
</template> </template>
</VnTable> </VnTable>
</template> </template>
<style lang="scss" scoped>
td .q-icon {
margin: 0 2px;
}
</style>

View File

@ -75,6 +75,19 @@ const columns = computed(() => [
}, },
visible: false, visible: false,
}, },
{
align: 'left',
label: t('supplier.list.tableVisibleColumns.country'),
name: 'country',
columnFilter: {
component: 'select',
name: 'countryFk',
attrs: {
url: 'countries',
fields: ['id', 'name'],
},
},
},
]); ]);
</script> </script>

View File

@ -28,18 +28,8 @@ const route = useRoute();
const router = useRouter(); const router = useRouter();
const state = useState(); const state = useState();
const { notify } = useNotify(); const { notify } = useNotify();
const thermographFilter = {
fields: ['thermographFk'],
where: {
travelFk: null,
},
order: 'thermographFk ASC',
};
const fetchTravelThermographsRef = ref(null);
const allowedContentTypes = ref(''); const allowedContentTypes = ref('');
const user = state.getUser(); const user = state.getUser();
const thermographsOptions = ref([]);
const dmsTypesOptions = ref([]); const dmsTypesOptions = ref([]);
const companiesOptions = ref([]); const companiesOptions = ref([]);
const warehousesOptions = ref([]); const warehousesOptions = ref([]);
@ -168,24 +158,15 @@ const updateThermograph = async () => {
}; };
const onThermographCreated = async (data) => { const onThermographCreated = async (data) => {
await fetchTravelThermographsRef.value.fetch(); thermographForm.thermographId = data.id;
thermographForm.thermographId = data.thermographId;
}; };
</script> </script>
<template> <template>
<FetchData <FetchData
url="DmsContainers/allowedContentTypes" url="DmsContainers/allowedContentTypes"
@on-fetch="(data) => (allowedContentTypes = data.join(', '))" @on-fetch="(data) => (allowedContentTypes = data.join(', '))"
auto-load auto-load
/> />
<FetchData
ref="fetchTravelThermographsRef"
url="TravelThermographs"
@on-fetch="(data) => (thermographsOptions = data)"
:filter="thermographFilter"
auto-load
/>
<FetchData <FetchData
url="DmsTypes" url="DmsTypes"
:filter="{ order: 'name' }" :filter="{ order: 'name' }"
@ -239,15 +220,20 @@ const onThermographCreated = async (data) => {
<VnSelectDialog <VnSelectDialog
:label="t('travel.thermographs.thermograph')" :label="t('travel.thermographs.thermograph')"
v-model="thermographForm.thermographId" v-model="thermographForm.thermographId"
:options="thermographsOptions" url="TravelThermographs"
option-value="thermographFk" option-value="thermographFk"
option-label="thermographFk" option-label="thermographFk"
:fields="['thermographFk']"
:where="{ travelFk: null }"
sort-by="thermographFk ASC"
:disable="viewAction === 'edit'" :disable="viewAction === 'edit'"
:tooltip="t('New thermograph')" :tooltip="t('New thermograph')"
> >
<template #form> <template #form>
<CreateThermographForm <CreateThermographForm
@on-data-saved="onThermographCreated($event, data)" @on-data-saved="
(data) => (thermographForm.thermographId = data.id)
"
/> />
</template> </template>
</VnSelectDialog> </VnSelectDialog>
@ -323,7 +309,6 @@ const onThermographCreated = async (data) => {
</QForm> </QForm>
</QPage> </QPage>
</template> </template>
<i18n> <i18n>
es: es:
Select files: Selecciona ficheros Select files: Selecciona ficheros

View File

@ -64,6 +64,15 @@ const agencyOptions = ref([]);
type="number" type="number"
min="0" min="0"
/> />
<VnInput
class="mw-10"
v-model="data.itemMaxLength"
:label="t('Max length m³')"
clearable
type="number"
min="0"
/>
</VnRow> </VnRow>
<VnRow> <VnRow>
@ -128,4 +137,5 @@ es:
Bonus: Bonificación Bonus: Bonificación
Inflation: Inflación Inflation: Inflación
Volumetric: Volumétrico Volumetric: Volumétrico
Max length : Medida máxima tumbado
</i18n> </i18n>

View File

@ -6,7 +6,6 @@ describe('EntryStockBought', () => {
}); });
it('Should edit the reserved space', () => { it('Should edit the reserved space', () => {
cy.get('.q-field__native.q-placeholder').should('have.value', '01/01/2001'); cy.get('.q-field__native.q-placeholder').should('have.value', '01/01/2001');
cy.get('tBody > tr').its('length').should('eq', 2);
cy.get('input[name="reserve"]').type('10{enter}'); cy.get('input[name="reserve"]').type('10{enter}');
cy.get('button[title="Save"]').click(); cy.get('button[title="Save"]').click();
cy.get('.q-notification__message').should('have.text', 'Data saved'); cy.get('.q-notification__message').should('have.text', 'Data saved');
@ -18,7 +17,6 @@ describe('EntryStockBought', () => {
cy.get('input[aria-label="Date"]').eq(1).type('01-01'); cy.get('input[aria-label="Date"]').eq(1).type('01-01');
cy.get('input[aria-label="Buyer"]').type('buyerboss{downarrow}{enter}'); cy.get('input[aria-label="Buyer"]').type('buyerboss{downarrow}{enter}');
cy.get('.q-notification__message').should('have.text', 'Data created'); cy.get('.q-notification__message').should('have.text', 'Data created');
cy.get('tBody > tr').its('length').should('eq', 3);
}); });
it('Should check detail for the buyer', () => { it('Should check detail for the buyer', () => {
cy.get(':nth-child(1) > .sticky > .q-btn > .q-btn__content > .q-icon').click(); cy.get(':nth-child(1) > .sticky > .q-btn > .q-btn__content > .q-icon').click();

View File

@ -11,7 +11,9 @@ describe('WagonCreate', () => {
cy.get('input').eq(1).type('1234ABCD'); cy.get('input').eq(1).type('1234ABCD');
cy.get('input').eq(2).type('100'); cy.get('input').eq(2).type('100');
cy.get('input').eq(3).click(); cy.get('input').eq(3).click();
cy.get('div[role="listbox"]').find('div.q-item').click(); cy.get('.q-select > .q-field__inner > .q-field__control').type(
'{downarrow}{enter}'
);
// Save // Save
cy.get('button[type="submit"]').click(); cy.get('button[type="submit"]').click();
@ -19,12 +21,22 @@ describe('WagonCreate', () => {
// Check data has been saved successfully // Check data has been saved successfully
cy.waitForElement('.q-card'); cy.waitForElement('.q-card');
cy.get('.title').should('have.text', '1234'); cy.get(
cy.get('[title-label="Plate"] > .value > span').should('have.text', '1234ABCD'); '[to="/null/1"] > .q-card > .no-padding > .q-py-none > .cursor-text'
cy.get(':nth-child(2) > .value > span').should('have.text', '100'); ).should('have.text', '1234');
cy.get(':nth-child(3) > .value > span').should('have.text', 'Wagon Type #1'); cy.get(
'[to="/null/1"] > .q-card > .no-padding > .q-pr-lg > :nth-child(1) > .vn-label-value > .value > :nth-child(1) > .row > span'
).should('have.text', '1234ABCD');
cy.get(
'[to="/null/1"] > .q-card > .no-padding > .q-pr-lg > :nth-child(2) > .vn-label-value > .value > :nth-child(1) > .row > span'
).should('have.text', '100');
cy.get(
'[to="/null/1"] > .q-card > .no-padding > .q-pr-lg > :nth-child(3) > .vn-label-value > .value > :nth-child(1) > .row > span'
).should('have.text', 'Wagon Type #1');
// Delete wagon type created // Delete wagon type created
cy.get('.actions > .q-btn--standard').click(); cy.get(
'[to="/null/2"] > .q-card > .column > [title="Remove"] > .q-btn__content > .q-icon'
).click();
}); });
}); });

View File

@ -13,7 +13,7 @@ describe('WagonTypeCreate', () => {
}); });
it('delete a wagon type', () => { it('delete a wagon type', () => {
cy.get( cy.get(
':nth-child(2) > :nth-child(1) > .card-list-body > .actions > .q-btn--standard' '[to="/null/2"] > .q-card > .column > [title="Remove"] > .q-btn__content > .q-icon'
).click(); ).click();
}); });
}); });

View File

@ -4,7 +4,7 @@ describe('WagonTypeEdit', () => {
beforeEach(() => { beforeEach(() => {
cy.viewport(1920, 1080); cy.viewport(1920, 1080);
cy.login('developer'); cy.login('developer');
cy.visit('/#/wagon/type/2/edit'); cy.visit('/#/wagon/type/1/edit');
}); });
it('should edit the name and the divisible field of the wagon type', () => { it('should edit the name and the divisible field of the wagon type', () => {
@ -14,14 +14,14 @@ describe('WagonTypeEdit', () => {
cy.get('.q-btn--standard').click(); cy.get('.q-btn--standard').click();
}); });
it('should create a tray', () => {
cy.get('.action-button > .q-btn > .q-btn__content > .q-icon').click();
cy.get('input').last().type('150');
cy.get(trayColorRow).type('{downArrow}{downArrow}{enter}');
});
it('should delete a tray', () => { it('should delete a tray', () => {
cy.get('.action-button > .q-btn > .q-btn__content > .q-icon').first().click(); cy.get('.action-button > .q-btn > .q-btn__content > .q-icon').first().click();
cy.reload(); cy.reload();
}); });
it('should create a tray', () => {
cy.get('.action-button > .q-btn > .q-btn__content > .q-icon').last().click();
cy.get('input').last().type('150');
cy.get(trayColorRow).type('{downArrow}{downArrow}{downArrow}{enter}');
});
}); });