0
0
Fork 0

Merge branch 'dev' into 7679_improve_newPostcode_form

This commit is contained in:
Javier Segarra 2024-10-02 22:08:13 +00:00
commit fef875270e
17 changed files with 304 additions and 46 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,9 +6,15 @@ entryFilter:
filter:
search: General search
reference: Reference
landed: Landed
shipped: Shipped
fromShipped: Shipped(from)
toShipped: Shipped(to)
printLabels: Print stickers
viewLabel: View sticker
myEntries:
id: ID
landed: Landed
shipped: Shipped
fromShipped: Shipped(from)
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:
search: Búsqueda general
reference: Referencia
landed: F. llegada
shipped: F. salida
fromShipped: F. salida(desde)
toShipped: F. salida(hasta)
printLabels: Imprimir etiquetas
viewLabel: Ver etiqueta
myEntries:
id: ID
landed: F. llegada
shipped: F. salida
fromShipped: F. salida(desde)
toShipped: F. salida(hasta)
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 TicketDescriptorProxy from '../Ticket/Card/TicketDescriptorProxy.vue';
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
const { t } = useI18n();
const tableRef = ref();
@ -64,7 +65,8 @@ const columns = computed(() => [
cardVisible: true,
attrs: {
url: 'Clients',
fields: ['id', 'name'],
optionLabel: 'socialName',
optionValue: 'socialName',
},
columnField: {
component: null,
@ -192,10 +194,33 @@ const downloadCSV = async () => {
<WorkerDescriptorProxy :id="row.comercialId" />
</span>
</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>
</template>
<i18n>
es:
Download as CSV: Descargar como CSV
params:
from: Desde
to: Hasta
en:
params:
from: From
to: To
</i18n>

View File

@ -277,13 +277,14 @@ async function createRefund(withWarehouse) {
const params = {
ticketsIds: [parseInt(ticketId)],
withWarehouse: withWarehouse,
negative: true,
};
const { data } = await axios.post(`Tickets/refund`, params);
const { data } = await axios.post(`Tickets/cloneAll`, params);
if (data) {
const refundTicket = data;
push({ name: 'TicketSale', params: { id: refundTicket[0].id } });
const [refundTicket] = data;
notify(t('refundTicketCreated', { ticketId: refundTicket.id }), 'positive');
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 { dialog } = useQuasar();
const { notify } = useNotify();
@ -142,7 +142,7 @@ const onCreateClaimAccepted = async () => {
try {
const params = { ticketId: ticket.value.id, sales: props.sales };
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) {
console.error('Error creating claim: ', error);
}
@ -169,7 +169,7 @@ const createRefund = async (withWarehouse) => {
const { data } = await axios.post('Tickets/cloneAll', params);
const [refundTicket] = data;
notify(t('refundTicketCreated', { ticketId: refundTicket.id }), 'positive');
router.push({ name: 'TicketSale', params: { id: refundTicket.id } });
push({ name: 'TicketSale', params: { id: refundTicket.id } });
} catch (error) {
console.error(error);
}

View File

@ -121,6 +121,20 @@ const thermographsTableColumns = computed(() => {
name: 'temperatureFk',
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'),
field: 'result',
@ -133,7 +147,7 @@ const thermographsTableColumns = computed(() => {
name: 'destination',
align: 'left',
format: (val) =>
warehouses.value.find((warehouse) => warehouse.id === val).name,
warehouses.value.find((warehouse) => warehouse.id === val)?.name,
},
{
label: t('travel.thermographs.created'),

View File

@ -52,12 +52,14 @@ const TableColumns = computed(() => {
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'),
@ -219,6 +221,4 @@ es:
Thermograph removed: Termógrafo eliminado
Are you sure you want to remove the thermograph?: ¿Seguro que quieres quitar el termógrafo?
No results: Sin resultados
Max Temperature: Temperatura máxima
Min Temperature: Temperatura mínima
</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 { toDate } from 'src/filters';
import { getDateQBadgeColor } from 'src/composables/getDateQBadgeColor.js';
import RightMenu from 'src/components/common/RightMenu.vue';
import TravelFilter from './TravelFilter.vue';
const { viewSummary } = useSummaryDialog();
const router = useRouter();
@ -24,6 +26,7 @@ const $props = defineProps({
});
const entityId = computed(() => $props.id || route.params.id);
const travelFilterRef = ref();
onMounted(async () => {
stateStore.rightDrawer = true;
});
@ -201,6 +204,11 @@ const columns = computed(() => [
:label="t('Search travel')"
data-key="TravelList"
/>
<RightMenu>
<template #right-panel>
<TravelFilter data-key="TravelList" ref="travelFilterRef" />
</template>
</RightMenu>
<VnTable
ref="tableRef"
data-key="TravelList"
@ -213,6 +221,7 @@ const columns = computed(() => [
editorFk: entityId,
},
}"
:right-search="false"
:user-params="{ daysOnward: 7 }"
order="landed DESC"
:columns="columns"
@ -220,7 +229,6 @@ const columns = computed(() => [
redirect="travel"
:is-editable="false"
:use-model="true"
chip-locale="travel.travelList.tableVisibleColumns"
>
<template #column-shipped="{ row }">
<QBadge

View File

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

View File

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