Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into dev
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Javi Gallego 2024-10-03 08:29:29 +02:00
commit ed5cf137b0
17 changed files with 304 additions and 46 deletions

View File

@ -108,6 +108,7 @@ async function search() {
...Object.fromEntries(staticParams), ...Object.fromEntries(staticParams),
search: searchText.value, search: searchText.value,
}, },
...{ filter: props.filter },
}; };
if (props.whereFilter) { if (props.whereFilter) {

View File

@ -50,6 +50,7 @@ globals:
summary: summary:
basicData: Basic data basicData: Basic data
daysOnward: Days onward daysOnward: Days onward
daysAgo: Days ago
today: Today today: Today
yesterday: Yesterday yesterday: Yesterday
dateFormat: en-GB dateFormat: en-GB
@ -289,8 +290,8 @@ globals:
createInvoiceIn: Create invoice in createInvoiceIn: Create invoice in
myAccount: My account myAccount: My account
noOne: No one noOne: No one
maxTemperature: Maximum Temperature maxTemperature: Max
minTemperature: Minimum Temperatura minTemperature: Min
params: params:
clientFk: Client id clientFk: Client id
salesPersonFk: Sales person salesPersonFk: Sales person

View File

@ -49,6 +49,7 @@ globals:
summary: summary:
basicData: Datos básicos basicData: Datos básicos
daysOnward: Días adelante daysOnward: Días adelante
daysAgo: Días atras
today: Hoy today: Hoy
yesterday: Ayer yesterday: Ayer
dateFormat: es-ES dateFormat: es-ES
@ -293,8 +294,8 @@ globals:
createInvoiceIn: Crear factura recibida createInvoiceIn: Crear factura recibida
myAccount: Mi cuenta myAccount: Mi cuenta
noOne: Nadie noOne: Nadie
maxTemperature: Temperatura máxima maxTemperature: Máx
minTemperature: Temperatura mínima minTemperature: Mín
params: params:
clientFk: Id cliente clientFk: Id cliente
salesPersonFk: Comercial salesPersonFk: Comercial

View File

@ -9,7 +9,9 @@ import { useSummaryDialog } from 'src/composables/useSummaryDialog';
const { t } = useI18n(); const { t } = useI18n();
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
const tableRef = ref(); const tableRef = ref();
const filter = {
include: { relation: 'role', scope: { fields: ['id', 'name'] } },
};
const columns = computed(() => [ const columns = computed(() => [
{ {
align: 'left', align: 'left',
@ -29,7 +31,22 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
name: 'username', name: 'roleFk',
label: t('role'),
columnFilter: {
component: 'select',
name: 'roleFk',
attrs: {
url: 'VnRoles',
optionValue: 'id',
optionLabel: 'name',
},
},
format: ({ role }, dashIfEmpty) => dashIfEmpty(role?.name),
},
{
align: 'left',
name: 'nickname',
label: t('Nickname'), label: t('Nickname'),
isTitle: true, isTitle: true,
component: 'input', component: 'input',
@ -104,12 +121,13 @@ const exprBuilder = (param, value) => {
:expr-builder="exprBuilder" :expr-builder="exprBuilder"
:label="t('account.search')" :label="t('account.search')"
:info="t('account.searchInfo')" :info="t('account.searchInfo')"
:filter="filter"
/> />
<VnTable <VnTable
ref="tableRef" ref="tableRef"
data-key="AccountUsers" data-key="AccountUsers"
url="VnUsers/preview" url="VnUsers/preview"
:filter="filter"
order="id DESC" order="id DESC"
:columns="columns" :columns="columns"
default-mode="table" default-mode="table"

View File

@ -11,6 +11,9 @@ const { t } = useI18n();
data-key="Account" data-key="Account"
:descriptor="AccountDescriptor" :descriptor="AccountDescriptor"
search-data-key="AccountUsers" search-data-key="AccountUsers"
:filter="{
include: { relation: 'role', scope: { fields: ['id', 'name'] } },
}"
:searchbar-props="{ :searchbar-props="{
url: 'VnUsers/preview', url: 'VnUsers/preview',
label: t('account.search'), label: t('account.search'),

View File

@ -9,22 +9,27 @@ import VnTable from 'components/VnTable/VnTable.vue';
const { t } = useI18n(); const { t } = useI18n();
const quasar = useQuasar(); const quasar = useQuasar();
const params = {
daysOnward: 7,
daysAgo: 3,
};
const columns = computed(() => [ const columns = computed(() => [
{ {
align: 'left', align: 'left',
name: 'id', name: 'id',
label: t('customer.extendedList.tableVisibleColumns.id'), label: t('myEntries.id'),
columnFilter: false, columnFilter: false,
isTitle: true, isTitle: true,
}, },
{ {
visible: false, visible: false,
align: 'right', align: 'right',
label: t('shipped'), label: t('myEntries.shipped'),
name: 'shipped', name: 'shipped',
columnFilter: { columnFilter: {
name: 'fromShipped', name: 'fromShipped',
label: t('fromShipped'), label: t('myEntries.fromShipped'),
component: 'date', component: 'date',
}, },
format: ({ shipped }) => toDate(shipped), format: ({ shipped }) => toDate(shipped),
@ -32,11 +37,11 @@ const columns = computed(() => [
{ {
visible: false, visible: false,
align: 'left', align: 'left',
label: t('shipped'), label: t('myEntries.shipped'),
name: 'shipped', name: 'shipped',
columnFilter: { columnFilter: {
name: 'toShipped', name: 'toShipped',
label: t('toShipped'), label: t('myEntries.toShipped'),
component: 'date', component: 'date',
}, },
format: ({ shipped }) => toDate(shipped), format: ({ shipped }) => toDate(shipped),
@ -44,14 +49,14 @@ const columns = computed(() => [
}, },
{ {
align: 'right', align: 'right',
label: t('shipped'), label: t('myEntries.shipped'),
name: 'shipped', name: 'shipped',
columnFilter: false, columnFilter: false,
format: ({ shipped }) => toDate(shipped), format: ({ shipped }) => toDate(shipped),
}, },
{ {
align: 'right', align: 'right',
label: t('landed'), label: t('myEntries.landed'),
name: 'landed', name: 'landed',
columnFilter: false, columnFilter: false,
format: ({ landed }) => toDate(landed), format: ({ landed }) => toDate(landed),
@ -59,26 +64,36 @@ const columns = computed(() => [
{ {
align: 'right', align: 'right',
label: t('globals.wareHouseIn'), label: t('myEntries.wareHouseIn'),
name: 'warehouseInFk', name: 'warehouseInFk',
format: (row) => row.warehouseInName, format: (row) => {
row.warehouseInName;
},
cardVisible: true, cardVisible: true,
columnFilter: { columnFilter: {
name: 'warehouseInFk',
label: t('myEntries.warehouseInFk'),
component: 'select', component: 'select',
attrs: { attrs: {
url: 'warehouses', url: 'warehouses',
fields: ['id', 'name'], fields: ['id', 'name'],
optionLabel: 'name', optionLabel: 'name',
optionValue: 'id', optionValue: 'id',
},
alias: 't', alias: 't',
},
inWhere: true, inWhere: true,
}, },
}, },
{ {
align: 'left', align: 'left',
label: t('globals.daysOnward'), label: t('myEntries.daysOnward'),
name: 'days', name: 'daysOnward',
visible: false,
},
{
align: 'left',
label: t('myEntries.daysAgo'),
name: 'daysAgo',
visible: false, visible: false,
}, },
{ {
@ -88,6 +103,7 @@ const columns = computed(() => [
{ {
title: t('printLabels'), title: t('printLabels'),
icon: 'print', icon: 'print',
isPrimary: true,
action: (row) => printBuys(row.id), action: (row) => printBuys(row.id),
}, },
], ],
@ -114,9 +130,11 @@ const printBuys = (rowId) => {
data-key="myEntriesList" data-key="myEntriesList"
url="Entries/filter" url="Entries/filter"
:columns="columns" :columns="columns"
:user-params="params"
default-mode="card" default-mode="card"
order="shipped DESC" order="shipped DESC"
auto-load auto-load
chip-locale="myEntries"
/> />
</template> </template>

View File

@ -6,9 +6,15 @@ entryFilter:
filter: filter:
search: General search search: General search
reference: Reference reference: Reference
landed: Landed myEntries:
shipped: Shipped id: ID
fromShipped: Shipped(from) landed: Landed
toShipped: Shipped(to) shipped: Shipped
printLabels: Print stickers fromShipped: Shipped(from)
viewLabel: View sticker toShipped: Shipped(to)
printLabels: Print stickers
viewLabel: View sticker
wareHouseIn: Warehouse in
warehouseInFk: Warehouse in
daysOnward: Days onward
daysAgo: Days ago

View File

@ -9,10 +9,15 @@ entryFilter:
filter: filter:
search: Búsqueda general search: Búsqueda general
reference: Referencia reference: Referencia
myEntries:
landed: F. llegada id: ID
shipped: F. salida landed: F. llegada
fromShipped: F. salida(desde) shipped: F. salida
toShipped: F. salida(hasta) fromShipped: F. salida(desde)
printLabels: Imprimir etiquetas toShipped: F. salida(hasta)
viewLabel: Ver etiqueta printLabels: Imprimir etiquetas
viewLabel: Ver etiqueta
wareHouseIn: Alm. entrada
warehouseInFk: Alm. entrada
daysOnward: Días adelante
daysAgo: Días atras

View File

@ -9,6 +9,7 @@ import { useArrayData } from 'src/composables/useArrayData';
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue'; import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
import TicketDescriptorProxy from '../Ticket/Card/TicketDescriptorProxy.vue'; import TicketDescriptorProxy from '../Ticket/Card/TicketDescriptorProxy.vue';
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
const { t } = useI18n(); const { t } = useI18n();
const tableRef = ref(); const tableRef = ref();
@ -64,7 +65,8 @@ const columns = computed(() => [
cardVisible: true, cardVisible: true,
attrs: { attrs: {
url: 'Clients', url: 'Clients',
fields: ['id', 'name'], optionLabel: 'socialName',
optionValue: 'socialName',
}, },
columnField: { columnField: {
component: null, component: null,
@ -192,10 +194,33 @@ const downloadCSV = async () => {
<WorkerDescriptorProxy :id="row.comercialId" /> <WorkerDescriptorProxy :id="row.comercialId" />
</span> </span>
</template> </template>
<template #moreFilterPanel="{ params }">
<VnInputDate
:label="t('params.from')"
v-model="params.from"
class="q-px-xs q-pr-lg"
filled
dense
/>
<VnInputDate
:label="t('params.to')"
v-model="params.to"
class="q-px-xs q-pr-lg"
filled
dense
/>
</template>
</VnTable> </VnTable>
</template> </template>
<i18n> <i18n>
es: es:
Download as CSV: Descargar como CSV Download as CSV: Descargar como CSV
params:
from: Desde
to: Hasta
en:
params:
from: From
to: To
</i18n> </i18n>

View File

@ -277,13 +277,14 @@ async function createRefund(withWarehouse) {
const params = { const params = {
ticketsIds: [parseInt(ticketId)], ticketsIds: [parseInt(ticketId)],
withWarehouse: withWarehouse, withWarehouse: withWarehouse,
negative: true,
}; };
const { data } = await axios.post(`Tickets/refund`, params); const { data } = await axios.post(`Tickets/cloneAll`, params);
if (data) { if (data) {
const refundTicket = data; const [refundTicket] = data;
notify(t('refundTicketCreated', { ticketId: refundTicket.id }), 'positive');
push({ name: 'TicketSale', params: { id: refundTicket[0].id } }); push({ name: 'TicketSale', params: { id: refundTicket.id } });
} }
} }

View File

@ -44,7 +44,7 @@ const props = defineProps({
}, },
}); });
const router = useRouter(); const { push } = useRouter();
const { t } = useI18n(); const { t } = useI18n();
const { dialog } = useQuasar(); const { dialog } = useQuasar();
const { notify } = useNotify(); const { notify } = useNotify();
@ -142,7 +142,7 @@ const onCreateClaimAccepted = async () => {
try { try {
const params = { ticketId: ticket.value.id, sales: props.sales }; const params = { ticketId: ticket.value.id, sales: props.sales };
const { data } = await axios.post(`Claims/createFromSales`, params); const { data } = await axios.post(`Claims/createFromSales`, params);
router.push({ name: 'ClaimBasicData', params: { id: data.id } }); push({ name: 'ClaimBasicData', params: { id: data.id } });
} catch (error) { } catch (error) {
console.error('Error creating claim: ', error); console.error('Error creating claim: ', error);
} }
@ -169,7 +169,7 @@ const createRefund = async (withWarehouse) => {
const { data } = await axios.post('Tickets/cloneAll', params); const { data } = await axios.post('Tickets/cloneAll', params);
const [refundTicket] = data; const [refundTicket] = data;
notify(t('refundTicketCreated', { ticketId: refundTicket.id }), 'positive'); notify(t('refundTicketCreated', { ticketId: refundTicket.id }), 'positive');
router.push({ name: 'TicketSale', params: { id: refundTicket.id } }); push({ name: 'TicketSale', params: { id: refundTicket.id } });
} catch (error) { } catch (error) {
console.error(error); console.error(error);
} }

View File

@ -121,6 +121,20 @@ const thermographsTableColumns = computed(() => {
name: 'temperatureFk', name: 'temperatureFk',
align: 'left', align: 'left',
}, },
{
label: t('globals.maxTemperature'),
field: 'maxTemperature',
name: 'maxTemperature',
align: 'left',
format: (val) => (val ? `${val}°` : ''),
},
{
label: t('globals.minTemperature'),
field: 'minTemperature',
name: 'minTemperature',
align: 'left',
format: (val) => (val ? `${val}°` : ''),
},
{ {
label: t('travel.thermographs.state'), label: t('travel.thermographs.state'),
field: 'result', field: 'result',
@ -133,7 +147,7 @@ const thermographsTableColumns = computed(() => {
name: 'destination', name: 'destination',
align: 'left', align: 'left',
format: (val) => format: (val) =>
warehouses.value.find((warehouse) => warehouse.id === val).name, warehouses.value.find((warehouse) => warehouse.id === val)?.name,
}, },
{ {
label: t('travel.thermographs.created'), label: t('travel.thermographs.created'),

View File

@ -52,12 +52,14 @@ const TableColumns = computed(() => {
field: 'maxTemperature', field: 'maxTemperature',
name: 'maxTemperature', name: 'maxTemperature',
align: 'left', align: 'left',
format: (val) => (val ? `${val}°` : ''),
}, },
{ {
label: t('globals.minTemperature'), label: t('globals.minTemperature'),
field: 'minTemperature', field: 'minTemperature',
name: 'minTemperature', name: 'minTemperature',
align: 'left', align: 'left',
format: (val) => (val ? `${val}°` : ''),
}, },
{ {
label: t('travel.thermographs.state'), label: t('travel.thermographs.state'),
@ -219,6 +221,4 @@ es:
Thermograph removed: Termógrafo eliminado Thermograph removed: Termógrafo eliminado
Are you sure you want to remove the thermograph?: ¿Seguro que quieres quitar el termógrafo? Are you sure you want to remove the thermograph?: ¿Seguro que quieres quitar el termógrafo?
No results: Sin resultados No results: Sin resultados
Max Temperature: Temperatura máxima
Min Temperature: Temperatura mínima
</i18n> </i18n>

View File

@ -0,0 +1,157 @@
<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 VnSelect from 'components/common/VnSelect.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import VnInputTime from 'src/components/common/VnInputTime.vue';
const { t } = useI18n();
const props = defineProps({
dataKey: {
type: String,
required: true,
},
});
const states = ref([]);
defineExpose({ states });
</script>
<template>
<FetchData url="warehouses" @on-fetch="(data) => (states = data)" auto-load />
<VnFilterPanel :data-key="props.dataKey" :search-button="true" search-url="table">
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
<strong>{{ t(`params.${tag.label}`) }}: </strong>
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
<template #body="{ params, searchFn }">
<div class="q-pa-sm q-gutter-y-sm">
<VnInput
:label="t('travel.Id')"
v-model="params.id"
lazy-rules
is-outlined
>
<template #prepend> <QIcon name="badge" size="xs" /></template>
</VnInput>
<VnInput
:label="t('travel.ref')"
v-model="params.ref"
lazy-rules
is-outlined
/>
<VnSelect
:label="t('travel.agency')"
v-model="params.agencyModeFk"
@update:model-value="searchFn()"
url="agencyModes"
:use-like="false"
option-value="id"
option-label="name"
option-filter="name"
dense
outlined
rounded
/>
<VnSelect
:label="t('travel.warehouseInFk')"
v-model="params.warehouseInFk"
@update:model-value="searchFn()"
url="warehouses"
:use-like="false"
option-value="id"
option-label="name"
option-filter="name"
dense
outlined
rounded
/>
<VnInputDate
:label="t('travel.shipped')"
v-model="params.shipped"
@update:model-value="searchFn()"
dense
outlined
rounded
/>
<VnInputTime
v-model="params.shipmentHour"
@update:model-value="searchFn()"
:label="t('travel.shipmentHour')"
outlined
rounded
dense
/>
<VnSelect
:label="t('travel.warehouseOut')"
v-model="params.warehouseOut"
@update:model-value="searchFn()"
url="warehouses"
:use-like="false"
option-value="id"
option-label="name"
option-filter="name"
dense
outlined
rounded
/>
<VnInputDate
:label="t('travel.landed')"
v-model="params.landed"
@update:model-value="searchFn()"
dense
outlined
rounded
/>
<VnInputTime
v-model="params.landingHour"
@update:model-value="searchFn()"
:label="t('travel.landingHour')"
outlined
rounded
dense
/>
<VnInput
:label="t('travel.totalEntries')"
v-model="params.totalEntries"
lazy-rules
is-outlined
/>
</div>
</template>
</VnFilterPanel>
</template>
<i18n>
en:
travel:
Id: Contains
ref: Reference
agency: Agency
warehouseInFk: W. In
shipped: Shipped
shipmentHour: Shipment Hour
warehouseOut: W. Out
landed: Landed
landingHour: Landing Hour
totalEntries: Σ
es:
travel:
Id: Id
ref: Referencia
agency: Agencia
warehouseInFk: Alm.Salida
shipped: F.Envío
shipmentHour: Hora de envío
warehouseOut: Alm.Entrada
landed: F.Entrega
landingHour: Hora de entrega
totalEntries: Σ
</i18n>

View File

@ -9,6 +9,8 @@ import TravelSummary from './Card/TravelSummary.vue';
import VnSearchbar from 'components/ui/VnSearchbar.vue'; import VnSearchbar from 'components/ui/VnSearchbar.vue';
import { toDate } from 'src/filters'; import { toDate } from 'src/filters';
import { getDateQBadgeColor } from 'src/composables/getDateQBadgeColor.js'; import { getDateQBadgeColor } from 'src/composables/getDateQBadgeColor.js';
import RightMenu from 'src/components/common/RightMenu.vue';
import TravelFilter from './TravelFilter.vue';
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
const router = useRouter(); const router = useRouter();
@ -24,6 +26,7 @@ const $props = defineProps({
}); });
const entityId = computed(() => $props.id || route.params.id); const entityId = computed(() => $props.id || route.params.id);
const travelFilterRef = ref();
onMounted(async () => { onMounted(async () => {
stateStore.rightDrawer = true; stateStore.rightDrawer = true;
}); });
@ -201,6 +204,11 @@ const columns = computed(() => [
:label="t('Search travel')" :label="t('Search travel')"
data-key="TravelList" data-key="TravelList"
/> />
<RightMenu>
<template #right-panel>
<TravelFilter data-key="TravelList" ref="travelFilterRef" />
</template>
</RightMenu>
<VnTable <VnTable
ref="tableRef" ref="tableRef"
data-key="TravelList" data-key="TravelList"
@ -213,6 +221,7 @@ const columns = computed(() => [
editorFk: entityId, editorFk: entityId,
}, },
}" }"
:right-search="false"
:user-params="{ daysOnward: 7 }" :user-params="{ daysOnward: 7 }"
order="landed DESC" order="landed DESC"
:columns="columns" :columns="columns"
@ -220,7 +229,6 @@ const columns = computed(() => [
redirect="travel" redirect="travel"
:is-editable="false" :is-editable="false"
:use-model="true" :use-model="true"
chip-locale="travel.travelList.tableVisibleColumns"
> >
<template #column-shipped="{ row }"> <template #column-shipped="{ row }">
<QBadge <QBadge

View File

@ -154,7 +154,7 @@ onMounted(() => {
</div> </div>
<div <div
v-if="excludeType === 'specificLocations'" v-if="excludeType === 'specificLocations'"
style="min-height: 60vh; overflow-y: scroll" style="max-height: 60vh; overflow-y: scroll"
> >
<ZoneLocationsTree <ZoneLocationsTree
:root-label="t('eventsExclusionForm.rootTreeLabel')" :root-label="t('eventsExclusionForm.rootTreeLabel')"

View File

@ -87,7 +87,7 @@ eventsPanel:
travelingDays: Días de viaje travelingDays: Días de viaje
price: Precio price: Precio
bonus: Bonificación bonus: Bonificación
m3Max: Meidida máxima m3Max: Medida máxima
everyday: Todos los días everyday: Todos los días
delete: Eliminar delete: Eliminar
deleteTitle: Este elemento será eliminado deleteTitle: Este elemento será eliminado