forked from verdnatura/salix-front
Merge pull request 'feature/ms-23-ExtraCommunity' (#26) from feature/ms-23-ExtraCommunity into dev
Reviewed-on: hyervoni/salix-front-mindshore#26
This commit is contained in:
commit
0dbb23075b
|
@ -1,7 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, useSlots, ref, watch, computed } from 'vue';
|
import { onMounted, useSlots, ref, watch, computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import axios from 'axios';
|
|
||||||
import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue';
|
import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
|
|
||||||
|
@ -34,7 +33,8 @@ const $props = defineProps({
|
||||||
|
|
||||||
const slots = useSlots();
|
const slots = useSlots();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const entity = computed(() => useArrayData($props.dataKey).store.data);
|
const entity = ref(null);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getData();
|
await getData();
|
||||||
watch(
|
watch(
|
||||||
|
@ -54,9 +54,9 @@ async function getData() {
|
||||||
skip: 0,
|
skip: 0,
|
||||||
});
|
});
|
||||||
const { data } = await arrayData.fetch({ append: false });
|
const { data } = await arrayData.fetch({ append: false });
|
||||||
|
entity.value = data;
|
||||||
emit('onFetch', data);
|
emit('onFetch', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
const emit = defineEmits(['onFetch']);
|
const emit = defineEmits(['onFetch']);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,16 @@ export default {
|
||||||
},
|
},
|
||||||
noSelectedRows: `You don't have any line selected`,
|
noSelectedRows: `You don't have any line selected`,
|
||||||
downloadCSVSuccess: 'CSV downloaded successfully',
|
downloadCSVSuccess: 'CSV downloaded successfully',
|
||||||
|
// labels compartidos entre vistas
|
||||||
|
reference: 'Reference',
|
||||||
|
agency: 'Agency',
|
||||||
|
wareHouseOut: 'Warehouse Out',
|
||||||
|
wareHouseIn: 'Warehouse In',
|
||||||
|
landed: 'Landed',
|
||||||
|
shipped: 'Shipped',
|
||||||
|
totalEntries: 'Total entries',
|
||||||
|
amount: 'Amount',
|
||||||
|
packages: 'Packages',
|
||||||
download: 'Download',
|
download: 'Download',
|
||||||
selectRows: 'Select all { numberRows } row(s)',
|
selectRows: 'Select all { numberRows } row(s)',
|
||||||
allRows: 'All { numberRows } row(s)',
|
allRows: 'All { numberRows } row(s)',
|
||||||
|
@ -233,7 +243,6 @@ export default {
|
||||||
invoice: 'Invoice',
|
invoice: 'Invoice',
|
||||||
shipped: 'Shipped',
|
shipped: 'Shipped',
|
||||||
landed: 'Landed',
|
landed: 'Landed',
|
||||||
packages: 'Packages',
|
|
||||||
consigneePhone: 'Consignee phone',
|
consigneePhone: 'Consignee phone',
|
||||||
consigneeMobile: 'Consignee mobile',
|
consigneeMobile: 'Consignee mobile',
|
||||||
clientPhone: 'Client phone',
|
clientPhone: 'Client phone',
|
||||||
|
@ -250,7 +259,6 @@ export default {
|
||||||
description: 'Description',
|
description: 'Description',
|
||||||
price: 'Price',
|
price: 'Price',
|
||||||
discount: 'Discount',
|
discount: 'Discount',
|
||||||
amount: 'Amount',
|
|
||||||
packing: 'Packing',
|
packing: 'Packing',
|
||||||
hasComponentLack: 'Component lack',
|
hasComponentLack: 'Component lack',
|
||||||
itemShortage: 'Not visible',
|
itemShortage: 'Not visible',
|
||||||
|
@ -343,7 +351,6 @@ export default {
|
||||||
assignedTo: 'Assigned',
|
assignedTo: 'Assigned',
|
||||||
created: 'Created',
|
created: 'Created',
|
||||||
state: 'State',
|
state: 'State',
|
||||||
packages: 'Packages',
|
|
||||||
picked: 'Picked',
|
picked: 'Picked',
|
||||||
returnOfMaterial: 'Return of material authorization (RMA)',
|
returnOfMaterial: 'Return of material authorization (RMA)',
|
||||||
},
|
},
|
||||||
|
@ -367,7 +374,6 @@ export default {
|
||||||
ref: 'Reference',
|
ref: 'Reference',
|
||||||
issued: 'Issued',
|
issued: 'Issued',
|
||||||
shortIssued: 'Issued',
|
shortIssued: 'Issued',
|
||||||
amount: 'Amount',
|
|
||||||
client: 'Client',
|
client: 'Client',
|
||||||
created: 'Created',
|
created: 'Created',
|
||||||
shortCreated: 'Created',
|
shortCreated: 'Created',
|
||||||
|
@ -377,7 +383,6 @@ export default {
|
||||||
},
|
},
|
||||||
card: {
|
card: {
|
||||||
issued: 'Issued',
|
issued: 'Issued',
|
||||||
amount: 'Amount',
|
|
||||||
client: 'Client',
|
client: 'Client',
|
||||||
company: 'Company',
|
company: 'Company',
|
||||||
customerCard: 'Customer card',
|
customerCard: 'Customer card',
|
||||||
|
@ -580,6 +585,7 @@ export default {
|
||||||
supplier: {
|
supplier: {
|
||||||
pageTitles: {
|
pageTitles: {
|
||||||
suppliers: 'Suppliers',
|
suppliers: 'Suppliers',
|
||||||
|
supplier: 'Supplier',
|
||||||
list: 'List',
|
list: 'List',
|
||||||
create: 'Create',
|
create: 'Create',
|
||||||
summary: 'Summary',
|
summary: 'Summary',
|
||||||
|
@ -621,25 +627,16 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
travel: {
|
travel: {
|
||||||
shared: {
|
|
||||||
reference: 'Reference',
|
|
||||||
agency: 'Agency',
|
|
||||||
wareHouseOut: 'Warehouse Out',
|
|
||||||
wareHouseIn: 'Warehouse In',
|
|
||||||
landed: 'Landed',
|
|
||||||
shipped: 'Shipped',
|
|
||||||
totalEntries: 'Total entries',
|
|
||||||
},
|
|
||||||
pageTitles: {
|
pageTitles: {
|
||||||
travel: 'Travels',
|
travel: 'Travels',
|
||||||
list: 'List',
|
list: 'List',
|
||||||
create: 'Create',
|
create: 'Create',
|
||||||
summary: 'Summary',
|
summary: 'Summary',
|
||||||
|
extraCommunity: 'Extra community',
|
||||||
},
|
},
|
||||||
summary: {
|
summary: {
|
||||||
confirmed: 'Confirmed',
|
confirmed: 'Confirmed',
|
||||||
entryId: 'Entry Id',
|
entryId: 'Entry Id',
|
||||||
supplier: 'Supplier',
|
|
||||||
freight: 'Freight',
|
freight: 'Freight',
|
||||||
package: 'Package',
|
package: 'Package',
|
||||||
delivered: 'Delivered',
|
delivered: 'Delivered',
|
||||||
|
@ -649,6 +646,16 @@ export default {
|
||||||
CloneTravelAndEntries: 'Clone travel and his entries',
|
CloneTravelAndEntries: 'Clone travel and his entries',
|
||||||
AddEntry: 'Add entry',
|
AddEntry: 'Add entry',
|
||||||
},
|
},
|
||||||
|
variables: {
|
||||||
|
search: 'Id/Reference',
|
||||||
|
agencyModeFk: 'Agency',
|
||||||
|
warehouseInFk: ' Warehouse In',
|
||||||
|
warehouseOutFk: 'Warehouse Out',
|
||||||
|
landedFrom: 'Landed from',
|
||||||
|
landedTo: 'Landed to',
|
||||||
|
continent: 'Continent out',
|
||||||
|
totalEntries: 'Total entries',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
topbar: {},
|
topbar: {},
|
||||||
|
|
|
@ -39,6 +39,16 @@ export default {
|
||||||
},
|
},
|
||||||
noSelectedRows: `No tienes ninguna línea seleccionada`,
|
noSelectedRows: `No tienes ninguna línea seleccionada`,
|
||||||
downloadCSVSuccess: 'Descarga de CSV exitosa',
|
downloadCSVSuccess: 'Descarga de CSV exitosa',
|
||||||
|
// labels compartidos entre vistas
|
||||||
|
reference: 'Referencia',
|
||||||
|
agency: 'Agencia',
|
||||||
|
wareHouseOut: 'Alm. salida',
|
||||||
|
wareHouseIn: 'Alm. entrada',
|
||||||
|
landed: 'F. entrega',
|
||||||
|
shipped: 'F. envío',
|
||||||
|
totalEntries: 'Ent. totales',
|
||||||
|
amount: 'Importe',
|
||||||
|
packages: 'Bultos',
|
||||||
download: 'Descargar',
|
download: 'Descargar',
|
||||||
selectRows: 'Seleccionar las { numberRows } filas(s)',
|
selectRows: 'Seleccionar las { numberRows } filas(s)',
|
||||||
allRows: 'Todo { numberRows } filas(s)',
|
allRows: 'Todo { numberRows } filas(s)',
|
||||||
|
@ -232,7 +242,6 @@ export default {
|
||||||
invoice: 'Factura',
|
invoice: 'Factura',
|
||||||
shipped: 'Enviado',
|
shipped: 'Enviado',
|
||||||
landed: 'Entregado',
|
landed: 'Entregado',
|
||||||
packages: 'Bultos',
|
|
||||||
consigneePhone: 'Tel. consignatario',
|
consigneePhone: 'Tel. consignatario',
|
||||||
consigneeMobile: 'Móv. consignatario',
|
consigneeMobile: 'Móv. consignatario',
|
||||||
clientPhone: 'Tel. cliente',
|
clientPhone: 'Tel. cliente',
|
||||||
|
@ -249,7 +258,6 @@ export default {
|
||||||
description: 'Descripción',
|
description: 'Descripción',
|
||||||
price: 'Precio',
|
price: 'Precio',
|
||||||
discount: 'Descuento',
|
discount: 'Descuento',
|
||||||
amount: 'Importe',
|
|
||||||
packing: 'Encajado',
|
packing: 'Encajado',
|
||||||
hasComponentLack: 'Faltan componentes',
|
hasComponentLack: 'Faltan componentes',
|
||||||
itemShortage: 'No visible',
|
itemShortage: 'No visible',
|
||||||
|
@ -342,7 +350,6 @@ export default {
|
||||||
assignedTo: 'Asignada a',
|
assignedTo: 'Asignada a',
|
||||||
created: 'Creada',
|
created: 'Creada',
|
||||||
state: 'Estado',
|
state: 'Estado',
|
||||||
packages: 'Bultos',
|
|
||||||
picked: 'Recogida',
|
picked: 'Recogida',
|
||||||
returnOfMaterial: 'Autorización de retorno de materiales (RMA)',
|
returnOfMaterial: 'Autorización de retorno de materiales (RMA)',
|
||||||
},
|
},
|
||||||
|
@ -367,7 +374,6 @@ export default {
|
||||||
ref: 'Referencia',
|
ref: 'Referencia',
|
||||||
issued: 'Fecha emisión',
|
issued: 'Fecha emisión',
|
||||||
shortIssued: 'F. emisión',
|
shortIssued: 'F. emisión',
|
||||||
amount: 'Importe',
|
|
||||||
client: 'Cliente',
|
client: 'Cliente',
|
||||||
created: 'Fecha creación',
|
created: 'Fecha creación',
|
||||||
shortCreated: 'F. creación',
|
shortCreated: 'F. creación',
|
||||||
|
@ -377,7 +383,6 @@ export default {
|
||||||
},
|
},
|
||||||
card: {
|
card: {
|
||||||
issued: 'Fecha emisión',
|
issued: 'Fecha emisión',
|
||||||
amount: 'Importe',
|
|
||||||
client: 'Cliente',
|
client: 'Cliente',
|
||||||
company: 'Empresa',
|
company: 'Empresa',
|
||||||
customerCard: 'Ficha del cliente',
|
customerCard: 'Ficha del cliente',
|
||||||
|
@ -582,6 +587,7 @@ export default {
|
||||||
supplier: {
|
supplier: {
|
||||||
pageTitles: {
|
pageTitles: {
|
||||||
suppliers: 'Proveedores',
|
suppliers: 'Proveedores',
|
||||||
|
supplier: 'Proveedor',
|
||||||
list: 'Listado',
|
list: 'Listado',
|
||||||
create: 'Crear',
|
create: 'Crear',
|
||||||
summary: 'Resumen',
|
summary: 'Resumen',
|
||||||
|
@ -602,7 +608,7 @@ export default {
|
||||||
payMethod: 'Método de pago',
|
payMethod: 'Método de pago',
|
||||||
payDeadline: 'Plazo de pago',
|
payDeadline: 'Plazo de pago',
|
||||||
payDay: 'Día de pago',
|
payDay: 'Día de pago',
|
||||||
account: 'Account',
|
account: 'Cuenta',
|
||||||
fiscalData: 'Data fiscal',
|
fiscalData: 'Data fiscal',
|
||||||
sageTaxType: 'Tipo de impuesto Sage',
|
sageTaxType: 'Tipo de impuesto Sage',
|
||||||
sageTransactionType: 'Tipo de transacción Sage',
|
sageTransactionType: 'Tipo de transacción Sage',
|
||||||
|
@ -623,25 +629,16 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
travel: {
|
travel: {
|
||||||
shared: {
|
|
||||||
reference: 'Referencia',
|
|
||||||
agency: 'Agencia',
|
|
||||||
wareHouseOut: 'Alm. salida',
|
|
||||||
wareHouseIn: 'Alm. entrada',
|
|
||||||
landed: 'F. entrega',
|
|
||||||
shipped: 'F. envío',
|
|
||||||
totalEntries: 'Ent. totales',
|
|
||||||
},
|
|
||||||
pageTitles: {
|
pageTitles: {
|
||||||
travel: 'Envíos',
|
travel: 'Envíos',
|
||||||
list: 'Listado',
|
list: 'Listado',
|
||||||
create: 'Crear',
|
create: 'Crear',
|
||||||
summary: 'Resumen',
|
summary: 'Resumen',
|
||||||
|
extraCommunity: 'Extra comunitarios',
|
||||||
},
|
},
|
||||||
summary: {
|
summary: {
|
||||||
confirmed: 'Confirmado',
|
confirmed: 'Confirmado',
|
||||||
entryId: 'Id entrada',
|
entryId: 'Id entrada',
|
||||||
supplier: 'Proveedor',
|
|
||||||
freight: 'Porte',
|
freight: 'Porte',
|
||||||
package: 'Embalaje',
|
package: 'Embalaje',
|
||||||
delivered: 'Enviada',
|
delivered: 'Enviada',
|
||||||
|
@ -651,6 +648,16 @@ export default {
|
||||||
CloneTravelAndEntries: 'Clonar travel y sus entradas',
|
CloneTravelAndEntries: 'Clonar travel y sus entradas',
|
||||||
AddEntry: 'Añadir entrada',
|
AddEntry: 'Añadir entrada',
|
||||||
},
|
},
|
||||||
|
variables: {
|
||||||
|
search: 'Id/Referencia',
|
||||||
|
agencyModeFk: 'Agencia',
|
||||||
|
warehouseInFk: 'Alm. entrada',
|
||||||
|
warehouseOutFk: ' Alm. salida',
|
||||||
|
landedFrom: 'Llegada desde',
|
||||||
|
landedTo: 'Llegada hasta',
|
||||||
|
continent: 'Cont. Salida',
|
||||||
|
totalEntries: 'Ent. totales',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
topbar: {},
|
topbar: {},
|
||||||
|
|
|
@ -184,7 +184,7 @@ const statesFilter = {
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<QInput
|
<QInput
|
||||||
v-model.number="data.packages"
|
v-model.number="data.packages"
|
||||||
:label="t('claim.basicData.packages')"
|
:label="t('globals.packages')"
|
||||||
:rules="validate('claim.packages')"
|
:rules="validate('claim.packages')"
|
||||||
type="number"
|
type="number"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -61,14 +61,11 @@ const setData = (entity) => (data.value = useCardDescription(entity.ref, entity.
|
||||||
data-key="invoiceOutData"
|
data-key="invoiceOutData"
|
||||||
>
|
>
|
||||||
<template #menu="{ entity }">
|
<template #menu="{ entity }">
|
||||||
<InvoiceOutDescriptorMenu :invoiceOut="entity" />
|
<InvoiceOutDescriptorMenu :invoice-out="entity" />
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="t('invoiceOut.card.issued')" :value="toDate(entity.issued)" />
|
<VnLv :label="t('invoiceOut.card.issued')" :value="toDate(entity.issued)" />
|
||||||
<VnLv
|
<VnLv :label="t('globals.amount')" :value="toCurrency(entity.amount)" />
|
||||||
:label="t('invoiceOut.card.amount')"
|
|
||||||
:value="toCurrency(entity.amount)"
|
|
||||||
/>
|
|
||||||
<VnLv v-if="entity.client" :label="t('invoiceOut.card.client')">
|
<VnLv v-if="entity.client" :label="t('invoiceOut.card.client')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<span class="link">
|
<span class="link">
|
||||||
|
|
|
@ -321,7 +321,7 @@ onMounted(async () => {
|
||||||
icon-right="search"
|
icon-right="search"
|
||||||
no-caps
|
no-caps
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
@click="search"
|
@click="search()"
|
||||||
/>
|
/>
|
||||||
<QBtn color="primary" icon-right="refresh" no-caps @click="refresh" />
|
<QBtn color="primary" icon-right="refresh" no-caps @click="refresh" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -0,0 +1,94 @@
|
||||||
|
<script setup>
|
||||||
|
import { ref, computed } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||||
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
|
import useCardDescription from 'src/composables/useCardDescription';
|
||||||
|
|
||||||
|
const $props = defineProps({
|
||||||
|
id: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
const filter = {
|
||||||
|
fields: [
|
||||||
|
'id',
|
||||||
|
'name',
|
||||||
|
'nickname',
|
||||||
|
'nif',
|
||||||
|
'payMethodFk',
|
||||||
|
'payDemFk',
|
||||||
|
'payDay',
|
||||||
|
'isActive',
|
||||||
|
'isSerious',
|
||||||
|
'isTrucker',
|
||||||
|
'account',
|
||||||
|
],
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
relation: 'payMethod',
|
||||||
|
scope: {
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
relation: 'payDem',
|
||||||
|
scope: {
|
||||||
|
fields: ['id', 'payDem'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
relation: 'client',
|
||||||
|
scope: {
|
||||||
|
fields: ['id', 'fi'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
const entityId = computed(() => {
|
||||||
|
return $props.id || route.params.id;
|
||||||
|
});
|
||||||
|
|
||||||
|
const data = ref(useCardDescription());
|
||||||
|
const setData = (entity) => {
|
||||||
|
data.value = useCardDescription(entity.ref, entity.id);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<CardDescriptor
|
||||||
|
module="Supplier"
|
||||||
|
:url="`Suppliers/${entityId}`"
|
||||||
|
:title="data.title"
|
||||||
|
:subtitle="data.subtitle"
|
||||||
|
:filter="filter"
|
||||||
|
@on-fetch="setData"
|
||||||
|
data-key="Supplier"
|
||||||
|
>
|
||||||
|
<template #body="{ entity }">
|
||||||
|
<VnLv :label="t('supplier.summary.taxNumber')" :value="entity.nif" />
|
||||||
|
<VnLv label="Alias" :value="entity.nickname" />
|
||||||
|
<VnLv
|
||||||
|
:label="t('supplier.summary.payMethod')"
|
||||||
|
:value="entity.payMethod.name"
|
||||||
|
/>
|
||||||
|
<VnLv
|
||||||
|
:label="t('supplier.summary.payDeadline')"
|
||||||
|
:value="entity.payDem.payDem"
|
||||||
|
/>
|
||||||
|
<VnLv :label="t('supplier.summary.payDay')" :value="entity.payDay" />
|
||||||
|
<VnLv :label="t('supplier.summary.account')" :value="entity.account" />
|
||||||
|
</template>
|
||||||
|
</CardDescriptor>
|
||||||
|
</template>
|
||||||
|
<i18n>
|
||||||
|
|
||||||
|
</i18n>
|
|
@ -0,0 +1,16 @@
|
||||||
|
<script setup>
|
||||||
|
import SupplierDescriptor from './SupplierDescriptor.vue';
|
||||||
|
|
||||||
|
const $props = defineProps({
|
||||||
|
id: {
|
||||||
|
type: Number,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<QPopupProxy>
|
||||||
|
<SupplierDescriptor v-if="$props.id" :id="$props.id" />
|
||||||
|
</QPopupProxy>
|
||||||
|
</template>
|
|
@ -7,6 +7,7 @@ import WorkerDescriptorProxy from 'pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import { getUrl } from 'src/composables/getUrl';
|
import { getUrl } from 'src/composables/getUrl';
|
||||||
import { useRole } from 'src/composables/useRole';
|
import { useRole } from 'src/composables/useRole';
|
||||||
|
import { dashIfEmpty } from 'src/filters';
|
||||||
|
|
||||||
onUpdated(() => summaryRef.value.fetch());
|
onUpdated(() => summaryRef.value.fetch());
|
||||||
|
|
||||||
|
@ -71,7 +72,7 @@ const isAdministrative = computed(() => {
|
||||||
<VnLv :label="t('supplier.summary.responsible')">
|
<VnLv :label="t('supplier.summary.responsible')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<span class="link">
|
<span class="link">
|
||||||
{{ supplier.worker?.user?.nickname || '-' }}
|
{{ dashIfEmpty(supplier.worker?.user?.nickname) }}
|
||||||
<WorkerDescriptorProxy
|
<WorkerDescriptorProxy
|
||||||
v-if="supplier.worker?.user?.id"
|
v-if="supplier.worker?.user?.id"
|
||||||
:id="supplier.worker?.user?.id"
|
:id="supplier.worker?.user?.id"
|
||||||
|
@ -81,14 +82,10 @@ const isAdministrative = computed(() => {
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('supplier.summary.notes')" class="q-mb-xs">
|
<VnLv :label="t('supplier.summary.notes')" class="q-mb-xs">
|
||||||
<template #value>
|
<template #value>
|
||||||
<span> {{ supplier.note || '-' }} </span>
|
<span> {{ dashIfEmpty(supplier.note) }} </span>
|
||||||
</template>
|
|
||||||
</VnLv>
|
|
||||||
<VnLv :label="t('supplier.summary.notes')" class="q-mb-xs">
|
|
||||||
<template #value>
|
|
||||||
<span> {{ supplier.note || '-' }} </span>
|
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
|
|
||||||
<VnLv :label="t('verified')" class="q-mb-xs">
|
<VnLv :label="t('verified')" class="q-mb-xs">
|
||||||
<template #value>
|
<template #value>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
|
@ -118,11 +115,13 @@ const isAdministrative = computed(() => {
|
||||||
<span v-else> {{ t('supplier.summary.billingData') }}</span>
|
<span v-else> {{ t('supplier.summary.billingData') }}</span>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('supplier.summary.payMethod')"
|
:label="t('supplier.summary.payMethod')"
|
||||||
:value="supplier.payMethod?.name || '-'"
|
:value="supplier.payMethod?.name"
|
||||||
|
dash
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('supplier.summary.payDeadline')"
|
:label="t('supplier.summary.payDeadline')"
|
||||||
:value="supplier.payDem?.payDem || '-'"
|
:value="supplier.payDem?.payDem"
|
||||||
|
dash
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('supplier.summary.payDay')" :value="supplier.payDay" />
|
<VnLv :label="t('supplier.summary.payDay')" :value="supplier.payDay" />
|
||||||
<VnLv :label="t('supplier.summary.account')" :value="supplier.account" />
|
<VnLv :label="t('supplier.summary.account')" :value="supplier.account" />
|
||||||
|
@ -135,19 +134,23 @@ const isAdministrative = computed(() => {
|
||||||
<span v-else> {{ t('supplier.summary.fiscalData') }}</span>
|
<span v-else> {{ t('supplier.summary.fiscalData') }}</span>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('supplier.summary.sageTaxType')"
|
:label="t('supplier.summary.sageTaxType')"
|
||||||
:value="supplier.sageTaxType?.vat || '-'"
|
:value="supplier.sageTaxType?.vat"
|
||||||
|
dash
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('supplier.summary.sageTransactionType')"
|
:label="t('supplier.summary.sageTransactionType')"
|
||||||
:value="supplier.sageTransactionType?.transaction || '-'"
|
:value="supplier.sageTransactionType?.transaction"
|
||||||
|
dash
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('supplier.summary.sageWithholding')"
|
:label="t('supplier.summary.sageWithholding')"
|
||||||
:value="supplier.sageWithholding?.withholding || '-'"
|
:value="supplier.sageWithholding?.withholding"
|
||||||
|
dash
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('supplier.summary.supplierActivity')"
|
:label="t('supplier.summary.supplierActivity')"
|
||||||
:value="supplier.supplierActivity?.name || '-'"
|
:value="supplier.supplierActivity?.name"
|
||||||
|
dash
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('supplier.summary.healthRegister')"
|
:label="t('supplier.summary.healthRegister')"
|
||||||
|
@ -170,11 +173,13 @@ const isAdministrative = computed(() => {
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('supplier.summary.province')"
|
:label="t('supplier.summary.province')"
|
||||||
:value="supplier.province?.name || '-'"
|
:value="supplier.province?.name"
|
||||||
|
dash
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('supplier.summary.country')"
|
:label="t('supplier.summary.country')"
|
||||||
:value="supplier.country?.country || '-'"
|
:value="supplier.country?.country"
|
||||||
|
dash
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -207,7 +207,7 @@ async function changeState(value) {
|
||||||
:label="t('ticket.summary.landed')"
|
:label="t('ticket.summary.landed')"
|
||||||
:value="toDate(ticket.landed)"
|
:value="toDate(ticket.landed)"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('ticket.summary.packages')" :value="ticket.packages" />
|
<VnLv :label="t('globals.packages')" :value="ticket.packages" />
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('ticket.summary.consigneePhone')"
|
:label="t('ticket.summary.consigneePhone')"
|
||||||
:value="ticket.address.phone"
|
:value="ticket.address.phone"
|
||||||
|
@ -267,7 +267,7 @@ async function changeState(value) {
|
||||||
<QTh auto-width>{{ t('ticket.summary.description') }}</QTh>
|
<QTh auto-width>{{ t('ticket.summary.description') }}</QTh>
|
||||||
<QTh auto-width>{{ t('ticket.summary.price') }}</QTh>
|
<QTh auto-width>{{ t('ticket.summary.price') }}</QTh>
|
||||||
<QTh auto-width>{{ t('ticket.summary.discount') }}</QTh>
|
<QTh auto-width>{{ t('ticket.summary.discount') }}</QTh>
|
||||||
<QTh auto-width>{{ t('ticket.summary.amount') }}</QTh>
|
<QTh auto-width>{{ t('globals.amount') }}</QTh>
|
||||||
<QTh auto-width>{{ t('ticket.summary.packing') }}</QTh>
|
<QTh auto-width>{{ t('ticket.summary.packing') }}</QTh>
|
||||||
</QTr>
|
</QTr>
|
||||||
</template>
|
</template>
|
||||||
|
@ -391,7 +391,7 @@ async function changeState(value) {
|
||||||
v-if="ticket.packagings.length > 0 || ticket.services.length > 0"
|
v-if="ticket.packagings.length > 0 || ticket.services.length > 0"
|
||||||
>
|
>
|
||||||
<a class="header link" :href="ticketUrl + 'package'">
|
<a class="header link" :href="ticketUrl + 'package'">
|
||||||
{{ t('ticket.summary.packages') }}
|
{{ t('globals.packages') }}
|
||||||
<QIcon name="open_in_new" color="primary" />
|
<QIcon name="open_in_new" color="primary" />
|
||||||
</a>
|
</a>
|
||||||
<QTable :rows="ticket.packagings" flat>
|
<QTable :rows="ticket.packagings" flat>
|
||||||
|
@ -422,7 +422,7 @@ async function changeState(value) {
|
||||||
<QTh auto-width>{{ t('ticket.summary.description') }}</QTh>
|
<QTh auto-width>{{ t('ticket.summary.description') }}</QTh>
|
||||||
<QTh auto-width>{{ t('ticket.summary.price') }}</QTh>
|
<QTh auto-width>{{ t('ticket.summary.price') }}</QTh>
|
||||||
<QTh auto-width>{{ t('ticket.summary.taxClass') }}</QTh>
|
<QTh auto-width>{{ t('ticket.summary.taxClass') }}</QTh>
|
||||||
<QTh auto-width>{{ t('ticket.summary.amount') }}</QTh>
|
<QTh auto-width>{{ t('globals.amount') }}</QTh>
|
||||||
</QTr>
|
</QTr>
|
||||||
</template>
|
</template>
|
||||||
<template #body="props">
|
<template #body="props">
|
||||||
|
|
|
@ -0,0 +1,80 @@
|
||||||
|
<script setup>
|
||||||
|
import { ref, computed } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { toDate } from 'src/filters';
|
||||||
|
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||||
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
|
import useCardDescription from 'src/composables/useCardDescription';
|
||||||
|
|
||||||
|
const $props = defineProps({
|
||||||
|
id: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
const filter = {
|
||||||
|
fields: [
|
||||||
|
'id',
|
||||||
|
'ref',
|
||||||
|
'shipped',
|
||||||
|
'landed',
|
||||||
|
'totalEntries',
|
||||||
|
'warehouseInFk',
|
||||||
|
'warehouseOutFk',
|
||||||
|
'cargoSupplierFk',
|
||||||
|
],
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
relation: 'warehouseIn',
|
||||||
|
scope: {
|
||||||
|
fields: ['name'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
relation: 'warehouseOut',
|
||||||
|
scope: {
|
||||||
|
fields: ['name'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
const entityId = computed(() => {
|
||||||
|
return $props.id || route.params.id;
|
||||||
|
});
|
||||||
|
|
||||||
|
const data = ref(useCardDescription());
|
||||||
|
|
||||||
|
const setData = (entity) => {
|
||||||
|
data.value = useCardDescription(entity.ref, entity.id);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<CardDescriptor
|
||||||
|
module="Travel"
|
||||||
|
:url="`Travels/${entityId}`"
|
||||||
|
:title="data.title"
|
||||||
|
:subtitle="data.subtitle"
|
||||||
|
:filter="filter"
|
||||||
|
@on-fetch="setData"
|
||||||
|
data-key="travelData"
|
||||||
|
>
|
||||||
|
<template #body="{ entity }">
|
||||||
|
<VnLv :label="t('globals.wareHouseIn')" :value="entity.warehouseIn.name" />
|
||||||
|
<VnLv :label="t('globals.wareHouseOut')" :value="entity.warehouseOut.name" />
|
||||||
|
<VnLv :label="t('globals.shipped')" :value="toDate(entity.shipped)" />
|
||||||
|
<VnLv :label="t('globals.landed')" :value="toDate(entity.landed)" />
|
||||||
|
<VnLv :label="t('globals.totalEntries')" :value="entity.totalEntries" />
|
||||||
|
</template>
|
||||||
|
</CardDescriptor>
|
||||||
|
</template>
|
||||||
|
<i18n>
|
||||||
|
|
||||||
|
</i18n>
|
|
@ -0,0 +1,16 @@
|
||||||
|
<script setup>
|
||||||
|
import TravelDescriptor from './TravelDescriptor.vue';
|
||||||
|
|
||||||
|
const $props = defineProps({
|
||||||
|
id: {
|
||||||
|
type: Number,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<QPopupProxy>
|
||||||
|
<TravelDescriptor v-if="$props.id" :id="$props.id" />
|
||||||
|
</QPopupProxy>
|
||||||
|
</template>
|
|
@ -114,13 +114,13 @@ const entriesTableColumns = computed(() => {
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('travel.summary.supplier'),
|
label: t('supplier.pageTitles.supplier'),
|
||||||
field: 'supplierName',
|
field: 'supplierName',
|
||||||
name: 'supplierName',
|
name: 'supplierName',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('travel.shared.reference'),
|
label: t('globals.reference'),
|
||||||
field: 'reference',
|
field: 'reference',
|
||||||
name: 'reference',
|
name: 'reference',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -208,24 +208,21 @@ const openEntryDescriptor = () => {};
|
||||||
|
|
||||||
<template #body>
|
<template #body>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
|
<VnLv :label="t('globals.shipped')" :value="toDate(travel.shipped)" />
|
||||||
|
<VnLv :label="t('globals.landed')" :value="toDate(travel.landed)" />
|
||||||
|
<VnLv :label="t('globals.agency')" :value="travel.agency?.name" />
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('travel.shared.shipped')"
|
:label="t('globals.wareHouseOut')"
|
||||||
:value="toDate(travel.shipped)"
|
|
||||||
/>
|
|
||||||
<VnLv :label="t('travel.shared.landed')" :value="toDate(travel.landed)" />
|
|
||||||
<VnLv :label="t('travel.shared.agency')" :value="travel.agency?.name" />
|
|
||||||
<VnLv
|
|
||||||
:label="t('travel.shared.wareHouseOut')"
|
|
||||||
:value="travel.warehouseOut?.name"
|
:value="travel.warehouseOut?.name"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('travel.shared.wareHouseIn')"
|
:label="t('globals.wareHouseIn')"
|
||||||
:value="travel.warehouseIn?.name"
|
:value="travel.warehouseIn?.name"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('travel.shared.reference')" :value="travel.ref" />
|
<VnLv :label="t('globals.reference')" :value="travel.ref" />
|
||||||
|
|
||||||
<VnLv label="m³" :value="travel.m3" />
|
<VnLv label="m³" :value="travel.m3" />
|
||||||
<VnLv :label="t('travel.shared.totalEntries')" :value="travel.m3" />
|
<VnLv :label="t('globals.totalEntries')" :value="travel.m3" />
|
||||||
|
|
||||||
<VnLv :label="t('travel.summary.delivered')" class="q-mb-xs">
|
<VnLv :label="t('travel.summary.delivered')" class="q-mb-xs">
|
||||||
<template #value>
|
<template #value>
|
||||||
|
|
|
@ -0,0 +1,377 @@
|
||||||
|
<script setup>
|
||||||
|
import { onMounted, ref, computed } from 'vue';
|
||||||
|
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
||||||
|
import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue';
|
||||||
|
import { QBtn, QField, QPopupEdit } from 'quasar';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
|
import { toCurrency } from 'src/filters';
|
||||||
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
|
import { toDate } from 'src/filters';
|
||||||
|
import { usePrintService } from 'composables/usePrintService';
|
||||||
|
import travelService from 'src/services/travel.service';
|
||||||
|
import ExtraCommunityFilter from './ExtraCommunityFilter.vue';
|
||||||
|
|
||||||
|
const stateStore = useStateStore();
|
||||||
|
const { t } = useI18n();
|
||||||
|
const { openReport } = usePrintService();
|
||||||
|
|
||||||
|
const shippedFrom = ref(Date.vnNew());
|
||||||
|
const landedTo = ref(Date.vnNew());
|
||||||
|
|
||||||
|
const arrayData = useArrayData('ExtraCommunity', {
|
||||||
|
url: 'Travels/extraCommunityFilter',
|
||||||
|
limit: 0,
|
||||||
|
order: [
|
||||||
|
'landed ASC',
|
||||||
|
'shipped ASC',
|
||||||
|
'travelFk',
|
||||||
|
'loadPriority',
|
||||||
|
'agencyModeFk',
|
||||||
|
'supplierName',
|
||||||
|
'evaNotes',
|
||||||
|
],
|
||||||
|
userParams: {
|
||||||
|
continent: 'AM',
|
||||||
|
shippedFrom: shippedFrom.value,
|
||||||
|
landedTo: landedTo.value,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const rows = computed(() => arrayData.store.data || []);
|
||||||
|
|
||||||
|
const tableColumnComponents = {
|
||||||
|
id: {
|
||||||
|
component: QBtn,
|
||||||
|
attrs: () => ({ flat: true, color: 'blue', class: 'col-content' }),
|
||||||
|
},
|
||||||
|
cargoSupplierNickname: {
|
||||||
|
component: QBtn,
|
||||||
|
attrs: () => ({ flat: true, color: 'blue', class: 'col-content' }),
|
||||||
|
},
|
||||||
|
agencyModeName: {
|
||||||
|
component: 'span',
|
||||||
|
attrs: () => ({ class: 'col-content' }),
|
||||||
|
},
|
||||||
|
invoiceAmount: {
|
||||||
|
component: 'span',
|
||||||
|
attrs: () => ({
|
||||||
|
class: 'col-content',
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
ref: {
|
||||||
|
component: QField,
|
||||||
|
attrs: () => ({ readonly: true, dense: true }),
|
||||||
|
},
|
||||||
|
stickers: {
|
||||||
|
component: 'span',
|
||||||
|
attrs: () => ({ class: 'col-content' }),
|
||||||
|
},
|
||||||
|
kg: {
|
||||||
|
component: 'span',
|
||||||
|
attrs: () => ({ class: 'col-content' }),
|
||||||
|
},
|
||||||
|
loadedKg: {
|
||||||
|
component: 'span',
|
||||||
|
attrs: () => ({ class: 'col-content' }),
|
||||||
|
},
|
||||||
|
volumeKg: {
|
||||||
|
component: 'span',
|
||||||
|
attrs: () => ({ class: 'col-content' }),
|
||||||
|
},
|
||||||
|
warehouseOutName: {
|
||||||
|
component: 'span',
|
||||||
|
attrs: () => ({ class: 'col-content' }),
|
||||||
|
},
|
||||||
|
shipped: {
|
||||||
|
component: 'span',
|
||||||
|
attrs: () => ({ class: 'col-content' }),
|
||||||
|
},
|
||||||
|
warehouseInName: {
|
||||||
|
component: 'span',
|
||||||
|
attrs: () => ({ class: 'col-content' }),
|
||||||
|
},
|
||||||
|
landed: {
|
||||||
|
component: 'span',
|
||||||
|
attrs: () => ({ class: 'col-content' }),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const columns = computed(() => {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: 'id',
|
||||||
|
field: 'id',
|
||||||
|
name: 'id',
|
||||||
|
align: 'left',
|
||||||
|
showValue: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('supplier.pageTitles.supplier'),
|
||||||
|
field: 'cargoSupplierNickname',
|
||||||
|
name: 'cargoSupplierNickname',
|
||||||
|
align: 'left',
|
||||||
|
showValue: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('globals.agency'),
|
||||||
|
field: 'agencyModeName',
|
||||||
|
name: 'agencyModeName',
|
||||||
|
align: 'left',
|
||||||
|
showValue: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('globals.amount'),
|
||||||
|
name: 'invoiceAmount',
|
||||||
|
field: 'entries',
|
||||||
|
align: 'left',
|
||||||
|
showValue: true,
|
||||||
|
format: (value) =>
|
||||||
|
toCurrency(
|
||||||
|
value
|
||||||
|
? value.reduce((sum, entry) => {
|
||||||
|
return sum + (entry.invoiceAmount || 0);
|
||||||
|
}, 0)
|
||||||
|
: 0
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('globals.reference'),
|
||||||
|
field: 'ref',
|
||||||
|
name: 'ref',
|
||||||
|
align: 'left',
|
||||||
|
showValue: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('globals.packages'),
|
||||||
|
field: 'stickers',
|
||||||
|
name: 'stickers',
|
||||||
|
align: 'left',
|
||||||
|
showValue: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('kg'),
|
||||||
|
field: 'kg',
|
||||||
|
name: 'kg',
|
||||||
|
align: 'left',
|
||||||
|
showValue: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('physicKg'),
|
||||||
|
field: 'loadedKg',
|
||||||
|
name: 'loadedKg',
|
||||||
|
align: 'left',
|
||||||
|
showValue: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'KG Vol.',
|
||||||
|
field: 'volumeKg',
|
||||||
|
name: 'volumeKg',
|
||||||
|
align: 'left',
|
||||||
|
showValue: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('globals.wareHouseOut'),
|
||||||
|
field: 'warehouseOutName',
|
||||||
|
name: 'warehouseOutName',
|
||||||
|
align: 'left',
|
||||||
|
showValue: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('shipped'),
|
||||||
|
field: 'shipped',
|
||||||
|
name: 'shipped',
|
||||||
|
align: 'left',
|
||||||
|
format: (value) => toDate(value.substring(0, 10)),
|
||||||
|
showValue: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('globals.wareHouseIn'),
|
||||||
|
field: 'warehouseInName',
|
||||||
|
name: 'warehouseInName',
|
||||||
|
align: 'left',
|
||||||
|
showValue: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('landed'),
|
||||||
|
field: 'landed',
|
||||||
|
name: 'landed',
|
||||||
|
align: 'left',
|
||||||
|
format: (value) => toDate(value.substring(0, 10)),
|
||||||
|
showValue: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|
||||||
|
async function getData() {
|
||||||
|
await arrayData.fetch({ append: false });
|
||||||
|
}
|
||||||
|
|
||||||
|
const openReportPdf = () => {
|
||||||
|
const params = {
|
||||||
|
...arrayData.store.userParams,
|
||||||
|
limit: arrayData.store.limit,
|
||||||
|
};
|
||||||
|
|
||||||
|
openReport('Travels/extra-community-pdf', params);
|
||||||
|
};
|
||||||
|
|
||||||
|
const saveFieldValue = async (val, field, index) => {
|
||||||
|
const id = rows.value[index].id;
|
||||||
|
const params = { [field]: val };
|
||||||
|
await travelService.updateTravel(id, params);
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
stateStore.rightDrawer = true;
|
||||||
|
|
||||||
|
shippedFrom.value.setDate(shippedFrom.value.getDate() - 2);
|
||||||
|
shippedFrom.value.setHours(0, 0, 0, 0);
|
||||||
|
|
||||||
|
landedTo.value.setDate(landedTo.value.getDate() + 7);
|
||||||
|
landedTo.value.setHours(23, 59, 59, 59);
|
||||||
|
await getData();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<QToolbar class="bg-vn-dark justify-end">
|
||||||
|
<div id="st-data"></div>
|
||||||
|
<QSpace />
|
||||||
|
<div id="st-actions">
|
||||||
|
<QBtn color="primary" icon-right="archive" no-caps @click="openReportPdf()" />
|
||||||
|
</div>
|
||||||
|
</QToolbar>
|
||||||
|
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
|
||||||
|
<QScrollArea class="fit text-grey-8">
|
||||||
|
<ExtraCommunityFilter data-key="ExtraCommunity" />
|
||||||
|
</QScrollArea>
|
||||||
|
</QDrawer>
|
||||||
|
<QPage class="column items-center q-pa-md">
|
||||||
|
<QTable
|
||||||
|
:rows="rows"
|
||||||
|
:columns="columns"
|
||||||
|
hide-bottom
|
||||||
|
row-key="clientId"
|
||||||
|
:pagination="{ rowsPerPage: 0 }"
|
||||||
|
class="full-width q-mt-md"
|
||||||
|
>
|
||||||
|
<template #body="props">
|
||||||
|
<QTr :props="props" class="bg-black">
|
||||||
|
<QTd v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
|
<component
|
||||||
|
:is="tableColumnComponents[col.name].component"
|
||||||
|
class="col-content"
|
||||||
|
v-bind="tableColumnComponents[col.name].attrs(props)"
|
||||||
|
>
|
||||||
|
<!-- Editable 'ref' and 'kg' QField slot -->
|
||||||
|
<template
|
||||||
|
v-if="col.name === 'ref' || col.name === 'kg'"
|
||||||
|
#control
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="self-center full-width no-outline"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
{{ col.value }}
|
||||||
|
</div>
|
||||||
|
<QPopupEdit
|
||||||
|
:key="col.name"
|
||||||
|
v-model="col.value"
|
||||||
|
label-set="Save"
|
||||||
|
label-cancel="Close"
|
||||||
|
>
|
||||||
|
<QInput
|
||||||
|
v-model="rows[props.pageIndex][col.field]"
|
||||||
|
dense
|
||||||
|
autofocus
|
||||||
|
@keyup.enter="
|
||||||
|
saveFieldValue(
|
||||||
|
rows[props.pageIndex][col.field],
|
||||||
|
col.field,
|
||||||
|
props.rowIndex
|
||||||
|
)
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
</QPopupEdit>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-if="col.showValue">
|
||||||
|
{{ col.value }}
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<!-- Main Row Descriptors -->
|
||||||
|
<TravelDescriptorProxy
|
||||||
|
v-if="col.name === 'id'"
|
||||||
|
:id="props.row.id"
|
||||||
|
/>
|
||||||
|
<SupplierDescriptorProxy
|
||||||
|
v-if="col.name === 'cargoSupplierNickname'"
|
||||||
|
:id="props.row.cargoSupplierFk"
|
||||||
|
/>
|
||||||
|
</component>
|
||||||
|
</QTd>
|
||||||
|
</QTr>
|
||||||
|
<QTr v-for="entry in props.row.entries" :key="entry.id" :props="props">
|
||||||
|
<QTd
|
||||||
|
><QBtn flat color="blue" class="col-content">{{ entry.id }}</QBtn>
|
||||||
|
<!-- Cuando se cree el modulo relacionado a entries, crear su descriptor y colocarlo acá -->
|
||||||
|
<!-- <EntryDescriptorProxy :id="entry.id"/> -->
|
||||||
|
</QTd>
|
||||||
|
<QTd
|
||||||
|
><QBtn flat color="blue" class="col-content">{{
|
||||||
|
entry.supplierName
|
||||||
|
}}</QBtn>
|
||||||
|
<SupplierDescriptorProxy :id="entry.supplierFk" />
|
||||||
|
</QTd>
|
||||||
|
<QTd></QTd>
|
||||||
|
<QTd
|
||||||
|
><span class="col-content">{{
|
||||||
|
toCurrency(entry.invoiceAmount)
|
||||||
|
}}</span></QTd
|
||||||
|
>
|
||||||
|
<QTd
|
||||||
|
><span class="col-content">{{ entry.reference }}</span></QTd
|
||||||
|
>
|
||||||
|
<QTd
|
||||||
|
><span class="col-content">{{ entry.stickers }}</span></QTd
|
||||||
|
>
|
||||||
|
<QTd></QTd>
|
||||||
|
<QTd
|
||||||
|
><span class="col-content">{{ entry.loadedkg }}</span></QTd
|
||||||
|
>
|
||||||
|
<QTd
|
||||||
|
><span class="col-content">{{ entry.volumeKg }}</span></QTd
|
||||||
|
>
|
||||||
|
<QTd></QTd>
|
||||||
|
<QTd></QTd>
|
||||||
|
<QTd></QTd>
|
||||||
|
</QTr>
|
||||||
|
</template>
|
||||||
|
<pre>{{ arrayData }}</pre>
|
||||||
|
</QTable>
|
||||||
|
</QPage>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.col-content {
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 6px 6px 6px 6px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<i18n>
|
||||||
|
en:
|
||||||
|
searchExtraCommunity: Search for extra community shipping
|
||||||
|
kg: BI. KG
|
||||||
|
physicKg: Phy. KG
|
||||||
|
shipped: W. shipped
|
||||||
|
landed: W. landed
|
||||||
|
|
||||||
|
es:
|
||||||
|
searchExtraCommunity: Buscar por envío extra comunitario
|
||||||
|
kg: KG Bloq.
|
||||||
|
physicKg: KG físico
|
||||||
|
shipped: F. envío
|
||||||
|
landed: F. llegada
|
||||||
|
</i18n>
|
|
@ -0,0 +1,306 @@
|
||||||
|
<script setup>
|
||||||
|
import { reactive } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||||
|
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
|
||||||
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
import { toDate } from 'src/filters';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const props = defineProps({
|
||||||
|
dataKey: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const filtersOptions = reactive({
|
||||||
|
warehouses: [],
|
||||||
|
continents: [],
|
||||||
|
agencies: [],
|
||||||
|
suppliers: [],
|
||||||
|
});
|
||||||
|
|
||||||
|
const updateFilterOptions = (data, optionKey) => {
|
||||||
|
filtersOptions[optionKey] = [...data];
|
||||||
|
};
|
||||||
|
|
||||||
|
const add = (paramsObj, key) => {
|
||||||
|
if (paramsObj[key] === undefined) {
|
||||||
|
paramsObj[key] = 1;
|
||||||
|
} else {
|
||||||
|
paramsObj[key]++;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const decrement = (paramsObj, key) => {
|
||||||
|
if (paramsObj[key] === 0) return;
|
||||||
|
|
||||||
|
paramsObj[key]--;
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<FetchData
|
||||||
|
url="Warehouses"
|
||||||
|
@on-fetch="(data) => updateFilterOptions(data, 'warehouses')"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="Continents"
|
||||||
|
@on-fetch="(data) => updateFilterOptions(data, 'continents')"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="AgencyModes"
|
||||||
|
@on-fetch="(data) => updateFilterOptions(data, 'agencies')"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="Suppliers"
|
||||||
|
@on-fetch="(data) => updateFilterOptions(data, 'suppliers')"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
|
|
||||||
|
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
||||||
|
<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 }">
|
||||||
|
<QList dense style="max-width: 256px" class="list">
|
||||||
|
<QItem class="q-my-sm">
|
||||||
|
<QItemSection>
|
||||||
|
<QInput label="id" dense outlined rounded v-model="params.id" />
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem class="q-my-sm">
|
||||||
|
<QItemSection>
|
||||||
|
<QInput
|
||||||
|
:label="t('params.ref')"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
v-model="params.reference"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem class="q-mb-sm">
|
||||||
|
<QItemSection>
|
||||||
|
<QInput
|
||||||
|
v-model="params.totalEntries"
|
||||||
|
type="number"
|
||||||
|
:label="t('params.totalEntries')"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
min="0"
|
||||||
|
class="input-number"
|
||||||
|
>
|
||||||
|
<template #append>
|
||||||
|
<QBtn
|
||||||
|
icon="add"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
size="12px"
|
||||||
|
@click="add(params, 'totalEntries')"
|
||||||
|
/>
|
||||||
|
<QBtn
|
||||||
|
icon="remove"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
size="12px"
|
||||||
|
@click="decrement(params, 'totalEntries')"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</QInput>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem class="q-mb-sm">
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelectFilter
|
||||||
|
:label="t('params.agencyModeFk')"
|
||||||
|
v-model="params.agencyModeFk"
|
||||||
|
:options="filtersOptions.agencies"
|
||||||
|
option-value="agencyFk"
|
||||||
|
option-label="name"
|
||||||
|
hide-selected
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem class="q-mb-sm">
|
||||||
|
<QItemSection>
|
||||||
|
<QInput
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
placeholder="dd-mm-aaa"
|
||||||
|
:label="t('params.shippedFrom')"
|
||||||
|
:model-value="toDate(params.shippedFrom)"
|
||||||
|
>
|
||||||
|
<template #append>
|
||||||
|
<QIcon name="event" class="cursor-pointer">
|
||||||
|
<QPopupProxy
|
||||||
|
cover
|
||||||
|
transition-show="scale"
|
||||||
|
transition-hide="scale"
|
||||||
|
>
|
||||||
|
<QDate v-model="params.shippedFrom">
|
||||||
|
<div class="row items-center justify-end">
|
||||||
|
<QBtn
|
||||||
|
v-close-popup
|
||||||
|
label="Close"
|
||||||
|
color="primary"
|
||||||
|
flat
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</QDate>
|
||||||
|
</QPopupProxy>
|
||||||
|
</QIcon>
|
||||||
|
</template>
|
||||||
|
</QInput>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem class="q-mb-sm">
|
||||||
|
<QItemSection>
|
||||||
|
<QInput
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
placeholder="dd-mm-aaa"
|
||||||
|
:model-value="toDate(params.landedTo)"
|
||||||
|
:label="t('params.landedTo')"
|
||||||
|
>
|
||||||
|
<template #append>
|
||||||
|
<QIcon name="event" class="cursor-pointer">
|
||||||
|
<QPopupProxy
|
||||||
|
cover
|
||||||
|
transition-show="scale"
|
||||||
|
transition-hide="scale"
|
||||||
|
>
|
||||||
|
<QDate v-model="params.landedTo">
|
||||||
|
<div class="row items-center justify-end">
|
||||||
|
<QBtn
|
||||||
|
v-close-popup
|
||||||
|
label="Close"
|
||||||
|
color="primary"
|
||||||
|
flat
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</QDate>
|
||||||
|
</QPopupProxy>
|
||||||
|
</QIcon>
|
||||||
|
</template>
|
||||||
|
</QInput>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem class="q-mb-sm">
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelectFilter
|
||||||
|
:label="t('params.warehouseOutFk')"
|
||||||
|
v-model="params.warehouseOutFk"
|
||||||
|
:options="filtersOptions.warehouses"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
hide-selected
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem class="q-mb-sm">
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelectFilter
|
||||||
|
:label="t('params.warehouseInFk')"
|
||||||
|
v-model="params.warehouseInFk"
|
||||||
|
:options="filtersOptions.warehouses"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
hide-selected
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem class="q-mb-sm">
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelectFilter
|
||||||
|
:label="t('supplier.pageTitles.supplier')"
|
||||||
|
v-model="params.cargoSupplierFk"
|
||||||
|
:options="filtersOptions.suppliers"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
hide-selected
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem class="q-mb-sm">
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelectFilter
|
||||||
|
:label="t('params.continent')"
|
||||||
|
v-model="params.continent"
|
||||||
|
:options="filtersOptions.continents"
|
||||||
|
option-value="code"
|
||||||
|
option-label="name"
|
||||||
|
hide-selected
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</QList>
|
||||||
|
</template>
|
||||||
|
</VnFilterPanel>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.list * {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-number >>> input[type='number'] {
|
||||||
|
-moz-appearance: textfield;
|
||||||
|
}
|
||||||
|
.input-number >>> input::-webkit-outer-spin-button,
|
||||||
|
.input-number >>> input::-webkit-inner-spin-button {
|
||||||
|
appearance: none;
|
||||||
|
-webkit-appearance: none;
|
||||||
|
-moz-appearance: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<i18n>
|
||||||
|
en:
|
||||||
|
params:
|
||||||
|
ref: Reference
|
||||||
|
totalEntries: Total entries
|
||||||
|
agencyModeFk: Agency
|
||||||
|
warehouseInFk: Warehouse In
|
||||||
|
warehouseOutFk: Warehouse Out
|
||||||
|
shippedFrom: Shipped from
|
||||||
|
landedTo: Landed to
|
||||||
|
cargoSupplierFk: Supplier
|
||||||
|
continent: Continent out
|
||||||
|
es:
|
||||||
|
params:
|
||||||
|
ref: Referencia
|
||||||
|
totalEntries: Ent. totales
|
||||||
|
agencyModeFk: Agencia
|
||||||
|
warehouseInFk: Alm. entrada
|
||||||
|
warehouseOutFk: Alm. salida
|
||||||
|
shippedFrom: Llegada desde
|
||||||
|
landedTo: Llegada hasta
|
||||||
|
cargoSupplierFk: Proveedor
|
||||||
|
continent: Cont. Salida
|
||||||
|
</i18n>
|
|
@ -70,14 +70,11 @@ const onFetchWarehouses = (warehouses) => {
|
||||||
<template #form="{ data }">
|
<template #form="{ data }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<QInput
|
<QInput v-model="data.ref" :label="t('globals.reference')" />
|
||||||
v-model="data.ref"
|
|
||||||
:label="t('travel.shared.reference')"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnSelectFilter
|
<VnSelectFilter
|
||||||
:label="t('travel.shared.agency')"
|
:label="t('globals.agency')"
|
||||||
v-model="data.agencyModeFk"
|
v-model="data.agencyModeFk"
|
||||||
:options="agenciesOptions"
|
:options="agenciesOptions"
|
||||||
option-value="agencyFk"
|
option-value="agencyFk"
|
||||||
|
@ -91,7 +88,7 @@ const onFetchWarehouses = (warehouses) => {
|
||||||
<QInput
|
<QInput
|
||||||
rounded
|
rounded
|
||||||
placeholder="dd-mm-aaa"
|
placeholder="dd-mm-aaa"
|
||||||
:label="t('travel.shared.landed')"
|
:label="t('globals.landed')"
|
||||||
:model-value="toDate(data.shipped)"
|
:model-value="toDate(data.shipped)"
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
|
@ -120,7 +117,7 @@ const onFetchWarehouses = (warehouses) => {
|
||||||
<QInput
|
<QInput
|
||||||
rounded
|
rounded
|
||||||
placeholder="dd-mm-aaa"
|
placeholder="dd-mm-aaa"
|
||||||
:label="t('travel.shared.landed')"
|
:label="t('globals.landed')"
|
||||||
:model-value="toDate(data.landed)"
|
:model-value="toDate(data.landed)"
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
|
@ -149,7 +146,7 @@ const onFetchWarehouses = (warehouses) => {
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnSelectFilter
|
<VnSelectFilter
|
||||||
:label="t('travel.shared.wareHouseOut')"
|
:label="t('globals.wareHouseOut')"
|
||||||
v-model="data.warehouseOutFk"
|
v-model="data.warehouseOutFk"
|
||||||
:options="warehousesOptions"
|
:options="warehousesOptions"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
|
@ -159,7 +156,7 @@ const onFetchWarehouses = (warehouses) => {
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnSelectFilter
|
<VnSelectFilter
|
||||||
:label="t('travel.shared.wareHouseIn')"
|
:label="t('globals.wareHouseIn')"
|
||||||
v-model="data.warehouseInFk"
|
v-model="data.warehouseInFk"
|
||||||
:options="warehousesOptions"
|
:options="warehousesOptions"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { reactive } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||||
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
|
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
|
||||||
|
@ -14,22 +14,14 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const warehousesOptions = ref([]);
|
const filtersOptions = reactive({
|
||||||
|
warehouses: [],
|
||||||
|
continents: [],
|
||||||
|
agencies: [],
|
||||||
|
});
|
||||||
|
|
||||||
const continentsOptions = ref([]);
|
const updateFilterOptions = (data, optionKey) => {
|
||||||
|
filtersOptions[optionKey] = [...data];
|
||||||
const agenciesOptions = ref([]);
|
|
||||||
|
|
||||||
const onFetchWarehouses = (warehouses) => {
|
|
||||||
warehousesOptions.value = [...warehouses];
|
|
||||||
};
|
|
||||||
|
|
||||||
const onFetchContinents = (continents) => {
|
|
||||||
continentsOptions.value = [...continents];
|
|
||||||
};
|
|
||||||
|
|
||||||
const onFetchAgencies = (agencies) => {
|
|
||||||
agenciesOptions.value = [...agencies];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const add = (paramsObj, key) => {
|
const add = (paramsObj, key) => {
|
||||||
|
@ -48,9 +40,21 @@ const decrement = (paramsObj, key) => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData url="Warehouses" @on-fetch="(data) => onFetchWarehouses(data)" auto-load />
|
<FetchData
|
||||||
<FetchData url="Continents" @on-fetch="(data) => onFetchContinents(data)" auto-load />
|
url="Warehouses"
|
||||||
<FetchData url="AgencyModes" @on-fetch="(data) => onFetchAgencies(data)" auto-load />
|
@on-fetch="(data) => updateFilterOptions(data, 'warehouses')"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="Continents"
|
||||||
|
@on-fetch="(data) => updateFilterOptions(data, 'continents')"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="AgencyModes"
|
||||||
|
@on-fetch="(data) => updateFilterOptions(data, 'agencies')"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
|
|
||||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn }">
|
||||||
|
@ -77,7 +81,7 @@ const decrement = (paramsObj, key) => {
|
||||||
<VnSelectFilter
|
<VnSelectFilter
|
||||||
:label="t('params.agencyModeFk')"
|
:label="t('params.agencyModeFk')"
|
||||||
v-model="params.agencyModeFk"
|
v-model="params.agencyModeFk"
|
||||||
:options="agenciesOptions"
|
:options="filtersOptions.agencies"
|
||||||
option-value="agencyFk"
|
option-value="agencyFk"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
hide-selected
|
hide-selected
|
||||||
|
@ -92,7 +96,7 @@ const decrement = (paramsObj, key) => {
|
||||||
<VnSelectFilter
|
<VnSelectFilter
|
||||||
:label="t('params.warehouseOutFk')"
|
:label="t('params.warehouseOutFk')"
|
||||||
v-model="params.warehouseOutFk"
|
v-model="params.warehouseOutFk"
|
||||||
:options="warehousesOptions"
|
:options="filtersOptions.warehouses"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
hide-selected
|
hide-selected
|
||||||
|
@ -107,7 +111,7 @@ const decrement = (paramsObj, key) => {
|
||||||
<VnSelectFilter
|
<VnSelectFilter
|
||||||
:label="t('params.warehouseInFk')"
|
:label="t('params.warehouseInFk')"
|
||||||
v-model="params.warehouseInFk"
|
v-model="params.warehouseInFk"
|
||||||
:options="warehousesOptions"
|
:options="filtersOptions.warehouses"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
hide-selected
|
hide-selected
|
||||||
|
@ -218,7 +222,7 @@ const decrement = (paramsObj, key) => {
|
||||||
<VnSelectFilter
|
<VnSelectFilter
|
||||||
:label="t('params.continent')"
|
:label="t('params.continent')"
|
||||||
v-model="params.continent"
|
v-model="params.continent"
|
||||||
:options="continentsOptions"
|
:options="filtersOptions.continents"
|
||||||
option-value="code"
|
option-value="code"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
hide-selected
|
hide-selected
|
||||||
|
|
|
@ -8,13 +8,11 @@ import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
||||||
import CardList from 'src/components/ui/CardList.vue';
|
import CardList from 'src/components/ui/CardList.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import TravelSummaryDialog from './Card/TravelSummaryDialog.vue';
|
import TravelSummaryDialog from './Card/TravelSummaryDialog.vue';
|
||||||
import { useTravelStore } from 'src/stores/travel.js';
|
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import TravelFilter from './TravelFilter.vue';
|
import TravelFilter from './TravelFilter.vue';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const travelStore = useTravelStore();
|
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
|
@ -42,7 +40,6 @@ const viewSummary = (id) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await travelStore.init();
|
|
||||||
stateStore.rightDrawer = true;
|
stateStore.rightDrawer = true;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -71,28 +68,28 @@ onMounted(async () => {
|
||||||
>
|
>
|
||||||
<template #list-items>
|
<template #list-items>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('travel.shared.agency')"
|
:label="t('globals.agency')"
|
||||||
:value="row.agencyModeName"
|
:value="row.agencyModeName"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('travel.shared.wareHouseOut')"
|
:label="t('globals.wareHouseOut')"
|
||||||
:value="row.warehouseOutFk"
|
:value="row.warehouseOutFk"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('travel.shared.shipped')"
|
:label="t('globals.shipped')"
|
||||||
:value="toDate(row.shipped)"
|
:value="toDate(row.shipped)"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('travel.shared.landed')"
|
:label="t('globals.landed')"
|
||||||
:value="toDate(row.landed)"
|
:value="toDate(row.landed)"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('travel.shared.wareHouseIn')"
|
:label="t('globals.wareHouseIn')"
|
||||||
:value="row.warehouseInFk"
|
:value="row.warehouseInFk"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('travel.shared.totalEntries')"
|
:label="t('globals.totalEntries')"
|
||||||
:value="row.totalEntries"
|
:value="row.totalEntries"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -10,7 +10,7 @@ export default {
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'TravelMain' },
|
redirect: { name: 'TravelMain' },
|
||||||
menus: {
|
menus: {
|
||||||
main: ['TravelList'],
|
main: ['TravelList', 'ExtraCommunity'],
|
||||||
card: [],
|
card: [],
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
@ -29,11 +29,21 @@ export default {
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Travel/TravelList.vue'),
|
component: () => import('src/pages/Travel/TravelList.vue'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'extra-community',
|
||||||
|
name: 'ExtraCommunity',
|
||||||
|
meta: {
|
||||||
|
title: 'extraCommunity',
|
||||||
|
icon: 'vn:shipment-01',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Travel/ExtraCommunity.vue'),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'create',
|
path: 'create',
|
||||||
name: 'TravelCreate',
|
name: 'TravelCreate',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'create',
|
title: 'extraCommunity',
|
||||||
|
icon: '',
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Travel/TravelCreate.vue'),
|
component: () => import('src/pages/Travel/TravelCreate.vue'),
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,15 +1,6 @@
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
const travelService = {
|
const travelService = {
|
||||||
getTravels: async (filter = {}) => {
|
|
||||||
try {
|
|
||||||
return await axios.get('Travels/filter', filter);
|
|
||||||
} catch (err) {
|
|
||||||
console.error(`Error fetching travels`, err);
|
|
||||||
return err.response;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
getTravelEntries: async (param) => {
|
getTravelEntries: async (param) => {
|
||||||
try {
|
try {
|
||||||
return await axios.get(`Travels/${param}/getEntries`);
|
return await axios.get(`Travels/${param}/getEntries`);
|
||||||
|
@ -18,6 +9,15 @@ const travelService = {
|
||||||
return err.response;
|
return err.response;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
updateTravel: async (id, params) => {
|
||||||
|
try {
|
||||||
|
return await axios.patch(`Travels/${id}`, params);
|
||||||
|
} catch (err) {
|
||||||
|
console.error(`Error updating travel`, err);
|
||||||
|
return err.response;
|
||||||
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default travelService;
|
export default travelService;
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
import { defineStore } from 'pinia';
|
|
||||||
import travelService from 'src/services/travel.service';
|
|
||||||
|
|
||||||
export const useTravelStore = defineStore({
|
|
||||||
id: 'travel',
|
|
||||||
|
|
||||||
state: () => ({
|
|
||||||
initialDataLoading: true,
|
|
||||||
travels: [],
|
|
||||||
}),
|
|
||||||
actions: {
|
|
||||||
async init() {
|
|
||||||
await this.fetchAllData();
|
|
||||||
},
|
|
||||||
|
|
||||||
async fetchAllData() {
|
|
||||||
const { data } = await travelService.getTravels();
|
|
||||||
this.travels = data || [];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
getters: {},
|
|
||||||
});
|
|
Loading…
Reference in New Issue