-
- {{ node.name }}
-
+
+
+ {{ node.name }}
+
+
+
+
{
+
es:
Departments: Departamentos
diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js
index 9e0ad7c9b..0cc91c88d 100644
--- a/src/i18n/en/index.js
+++ b/src/i18n/en/index.js
@@ -24,6 +24,7 @@ export default {
dataCreated: 'Data created',
add: 'Add',
create: 'Create',
+ edit: 'Edit',
save: 'Save',
remove: 'Remove',
reset: 'Reset',
@@ -64,12 +65,23 @@ export default {
markAll: 'Mark all',
requiredField: 'Required field',
class: 'clase',
- type: 'type',
+ type: 'Type',
reason: 'reason',
noResults: 'No results',
system: 'System',
+ warehouse: 'Warehouse',
+ company: 'Company',
fieldRequired: 'Field required',
allowedFilesText: 'Allowed file types: { allowedContentTypes }',
+ confirmDeletion: 'Confirm deletion',
+ confirmDeletionMessage: 'Are you sure you want to delete this?',
+ description: 'Description',
+ id: 'Id',
+ order: 'Order',
+ original: 'Original',
+ file: 'File',
+ selectFile: 'Select a file',
+ copyClipboard: 'Copy on clipboard',
},
errors: {
statusUnauthorized: 'Access denied',
@@ -77,7 +89,7 @@ export default {
statusBadGateway: 'It seems that the server has fall down',
statusGatewayTimeout: 'Could not contact the server',
userConfig: 'Error fetching user config',
- create: 'Error during creation',
+ writeRequest: 'The requested operation could not be completed',
},
login: {
title: 'Login',
@@ -166,7 +178,7 @@ export default {
fiscalAddress: 'Fiscal address',
fiscalData: 'Fiscal data',
billingData: 'Billing data',
- consignee: 'Consignee',
+ consignee: 'Default consignee',
businessData: 'Business data',
financialData: 'Financial data',
customerId: 'Customer ID',
@@ -219,6 +231,8 @@ export default {
recoverySince: 'Recovery since',
businessType: 'Business Type',
city: 'City',
+ rating: 'Rating',
+ recommendCredit: 'Recommended credit',
},
basicData: {
socialName: 'Fiscal name',
@@ -273,6 +287,7 @@ export default {
basicData: 'Basic data',
buys: 'Buys',
notes: 'Notes',
+ dms: 'File management',
log: 'Log',
create: 'Create',
latestBuys: 'Latest buys',
@@ -344,7 +359,6 @@ export default {
reference: 'Reference',
observations: 'Observations',
item: 'Item',
- description: 'Description',
size: 'Size',
packing: 'Packing',
grouping: 'Grouping',
@@ -359,7 +373,6 @@ export default {
},
notes: {
observationType: 'Observation type',
- description: 'Description',
},
descriptor: {
agency: 'Agency',
@@ -372,7 +385,6 @@ export default {
packing: 'Packing',
grouping: 'Grouping',
quantity: 'Quantity',
- description: 'Description',
size: 'Size',
tags: 'Tags',
type: 'Type',
@@ -458,7 +470,6 @@ export default {
visible: 'Visible',
available: 'Available',
quantity: 'Quantity',
- description: 'Description',
price: 'Price',
discount: 'Discount',
packing: 'Packing',
@@ -531,7 +542,6 @@ export default {
landed: 'Landed',
quantity: 'Quantity',
claimed: 'Claimed',
- description: 'Description',
price: 'Price',
discount: 'Discount',
total: 'Total',
@@ -793,7 +803,6 @@ export default {
orderTicketList: 'Order Ticket List',
details: 'Details',
item: 'Item',
- description: 'Description',
quantity: 'Quantity',
price: 'Price',
amount: 'Amount',
@@ -1138,7 +1147,6 @@ export default {
warehouse: 'Warehouse',
travelFileDescription: 'Travel id { travelId }',
file: 'File',
- description: 'Description',
},
},
item: {
@@ -1172,7 +1180,6 @@ export default {
clone: 'Clone',
openCard: 'View',
openSummary: 'Summary',
- viewDescription: 'Description',
},
cardDescriptor: {
mainList: 'Main list',
diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js
index 6083dfad7..7369721e6 100644
--- a/src/i18n/es/index.js
+++ b/src/i18n/es/index.js
@@ -24,6 +24,7 @@ export default {
dataCreated: 'Datos creados',
add: 'Añadir',
create: 'Crear',
+ edit: 'Modificar',
save: 'Guardar',
remove: 'Eliminar',
reset: 'Restaurar',
@@ -64,12 +65,23 @@ export default {
markAll: 'Marcar todo',
requiredField: 'Campo obligatorio',
class: 'clase',
- type: 'tipo',
+ type: 'Tipo',
reason: 'motivo',
noResults: 'Sin resultados',
system: 'Sistema',
+ warehouse: 'Almacén',
+ company: 'Empresa',
fieldRequired: 'Campo requerido',
allowedFilesText: 'Tipos de archivo permitidos: { allowedContentTypes }',
+ confirmDeletion: 'Confirmar eliminación',
+ confirmDeletionMessage: '¿Seguro que quieres eliminar?',
+ description: 'Descripción',
+ id: 'Id',
+ order: 'Orden',
+ original: 'Original',
+ file: 'Fichero',
+ selectFile: 'Seleccione un fichero',
+ copyClipboard: 'Copiar en portapapeles',
},
errors: {
statusUnauthorized: 'Acceso denegado',
@@ -77,7 +89,7 @@ export default {
statusBadGateway: 'Parece ser que el servidor ha caído',
statusGatewayTimeout: 'No se ha podido contactar con el servidor',
userConfig: 'Error al obtener configuración de usuario',
- create: 'Error al crear',
+ writeRequest: 'No se pudo completar la operación solicitada',
},
login: {
title: 'Inicio de sesión',
@@ -165,7 +177,7 @@ export default {
fiscalAddress: 'Dirección fiscal',
fiscalData: 'Datos fiscales',
billingData: 'Datos de facturación',
- consignee: 'Consignatario',
+ consignee: 'Consignatario pred.',
businessData: 'Datos comerciales',
financialData: 'Datos financieros',
customerId: 'ID cliente',
@@ -218,6 +230,8 @@ export default {
recoverySince: 'Recobro desde',
businessType: 'Tipo de negocio',
city: 'Población',
+ rating: 'Clasificación',
+ recommendCredit: 'Crédito recomendado',
},
basicData: {
socialName: 'Nombre fiscal',
@@ -272,6 +286,7 @@ export default {
basicData: 'Datos básicos',
buys: 'Compras',
notes: 'Notas',
+ dms: 'Gestión documental',
log: 'Historial',
create: 'Crear',
latestBuys: 'Últimas compras',
@@ -343,7 +358,6 @@ export default {
reference: 'Referencia',
observations: 'Observaciónes',
item: 'Artículo',
- description: 'Descripción',
size: 'Medida',
packing: 'Packing',
grouping: 'Grouping',
@@ -358,7 +372,6 @@ export default {
},
notes: {
observationType: 'Tipo de observación',
- description: 'Descripción',
},
descriptor: {
agency: 'Agencia',
@@ -371,7 +384,6 @@ export default {
packing: 'Packing',
grouping: 'Grouping',
quantity: 'Cantidad',
- description: 'Descripción',
size: 'Medida',
tags: 'Etiquetas',
type: 'Tipo',
@@ -457,7 +469,6 @@ export default {
visible: 'Visible',
available: 'Disponible',
quantity: 'Cantidad',
- description: 'Descripción',
price: 'Precio',
discount: 'Descuento',
packing: 'Encajado',
@@ -530,7 +541,6 @@ export default {
landed: 'Entregado',
quantity: 'Cantidad',
claimed: 'Reclamado',
- description: 'Descripción',
price: 'Precio',
discount: 'Descuento',
total: 'Total',
@@ -701,7 +711,6 @@ export default {
orderTicketList: 'Tickets del pedido',
details: 'Detalles',
item: 'Item',
- description: 'Descripción',
quantity: 'Cantidad',
price: 'Precio',
amount: 'Monto',
@@ -1138,7 +1147,6 @@ export default {
warehouse: 'Almacén',
travelFileDescription: 'Id envío { travelId }',
file: 'Fichero',
- description: 'Descripción',
},
},
item: {
@@ -1172,7 +1180,6 @@ export default {
clone: 'Clonar',
openCard: 'Ficha',
openSummary: 'Detalles',
- viewDescription: 'Descripción',
},
cardDescriptor: {
mainList: 'Listado principal',
diff --git a/src/pages/Claim/Card/ClaimSummary.vue b/src/pages/Claim/Card/ClaimSummary.vue
index cdc1f15be..b93cbbd81 100644
--- a/src/pages/Claim/Card/ClaimSummary.vue
+++ b/src/pages/Claim/Card/ClaimSummary.vue
@@ -35,7 +35,6 @@ const claimDmsFilter = ref({
relation: 'dms',
},
],
- where: { claimFk: entityId.value },
});
onMounted(async () => {
@@ -141,6 +140,11 @@ const claimDms = ref([]);
const multimediaDialog = ref();
const multimediaSlide = ref();
+async function getClaimDms() {
+ claimDmsFilter.value.where = { claimFk: entityId.value };
+ await claimDmsRef.value.fetch();
+}
+
function setClaimDms(data) {
claimDms.value = [];
data.forEach((media) => {
@@ -163,10 +167,13 @@ function openDialog(dmsId) {
url="ClaimDms"
:filter="claimDmsFilter"
@on-fetch="(data) => setClaimDms(data)"
- limit="20"
ref="claimDmsRef"
/>
-
+
{{ claim.id }} - {{ claim.client.name }}
@@ -252,7 +259,8 @@ function openDialog(dmsId) {
>
@@ -274,7 +282,6 @@ function openDialog(dmsId) {
-
{
link
>
{{ t('customer.summary.financialData') }}
-
+
+
{
:label="t('customer.summary.recoverySince')"
:value="toDate(entity.recovery.started)"
/>
+
+
+
+
+
+en:
+ valueInfo: Value from {min} to {max}. The higher the better value
+es:
+ valueInfo: Valor de {min} a {max}. Cuanto más alto, mejor valor
+
diff --git a/src/pages/Customer/ExtendedList/CustomerExtendedList.vue b/src/pages/Customer/ExtendedList/CustomerExtendedList.vue
index 69effe88e..9d98f479c 100644
--- a/src/pages/Customer/ExtendedList/CustomerExtendedList.vue
+++ b/src/pages/Customer/ExtendedList/CustomerExtendedList.vue
@@ -13,7 +13,7 @@ import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import { useArrayData } from 'composables/useArrayData';
import { useStateStore } from 'stores/useStateStore';
-import { dashIfEmpty, toDate } from 'src/filters';
+import { toDate } from 'src/filters';
const { t } = useI18n();
const router = useRouter();
@@ -477,17 +477,11 @@ const stopEventPropagation = (event, col) => {
event.stopPropagation();
};
-const navigateToTravelId = (id) => {
- router.push({ path: `/customer/${id}` });
-};
+const navigateToTravelId = (id) => router.push({ path: `/customer/${id}` });
-const selectCustomerId = (id) => {
- selectedCustomerId.value = id;
-};
+const selectCustomerId = (id) => (selectedCustomerId.value = id);
-const selectSalesPersonId = (id) => {
- selectedSalesPersonId.value = id;
-};
+const selectSalesPersonId = (id) => (selectedSalesPersonId.value = id);
@@ -521,37 +515,50 @@ const selectSalesPersonId = (id) => {
class="full-width q-mt-md"
row-key="id"
:visible-columns="visibleColumns"
+ @row-click="(evt, row, id) => navigateToTravelId(row.id)"
>
-
-
-
+
+ {{ value }}
+
+
+
+
+
-
- {{ dashIfEmpty(col.value) }}
-
-
-
-
-
+
+ {{ props.row.id }}
+
+
+
+
+
+
+
+ {{ props.row.salesPerson }}
+
+ -
+
+
+
+
+
+
diff --git a/src/pages/Department/Card/DepartmentDescriptorProxy.vue b/src/pages/Department/Card/DepartmentDescriptorProxy.vue
new file mode 100644
index 000000000..07a6b6af1
--- /dev/null
+++ b/src/pages/Department/Card/DepartmentDescriptorProxy.vue
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
diff --git a/src/pages/Department/Card/DepartmentSummaryDialog.vue b/src/pages/Department/Card/DepartmentSummaryDialog.vue
new file mode 100644
index 000000000..3bf4d7a26
--- /dev/null
+++ b/src/pages/Department/Card/DepartmentSummaryDialog.vue
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/Entry/Card/EntryBuysImport.vue b/src/pages/Entry/Card/EntryBuysImport.vue
index 21f0beada..3e0ac1410 100644
--- a/src/pages/Entry/Card/EntryBuysImport.vue
+++ b/src/pages/Entry/Card/EntryBuysImport.vue
@@ -44,7 +44,7 @@ const columns = computed(() => [
align: 'left',
},
{
- label: t('entry.buys.description'),
+ label: t('globals.description'),
name: 'description',
field: 'description',
align: 'left',
@@ -214,7 +214,7 @@ const redirectToBuysView = () => {
class="cursor-pointer"
@click="inputFileRef.pickFiles()"
>
- {{ t('Select a file') }}
+ {{ t('globals.selectFile') }}
@@ -292,6 +292,6 @@ const redirectToBuysView = () => {
es:
- Select a file: Selecciona un fichero
+ globals.selectFile: Selecciona un fichero
Some of the imported buys does not have an item: Algunas de las compras importadas no tienen un artículo
diff --git a/src/pages/Entry/Card/EntryDescriptor.vue b/src/pages/Entry/Card/EntryDescriptor.vue
index 32421f9bc..6680bdc46 100644
--- a/src/pages/Entry/Card/EntryDescriptor.vue
+++ b/src/pages/Entry/Card/EntryDescriptor.vue
@@ -1,5 +1,5 @@
+
+
+
diff --git a/src/pages/Entry/Card/EntryNotes.vue b/src/pages/Entry/Card/EntryNotes.vue
index f56e59253..0d2e5e51a 100644
--- a/src/pages/Entry/Card/EntryNotes.vue
+++ b/src/pages/Entry/Card/EntryNotes.vue
@@ -63,7 +63,7 @@ onMounted(() => {
diff --git a/src/pages/Entry/EntryLatestBuys.vue b/src/pages/Entry/EntryLatestBuys.vue
index f4a423f3b..09a6a2f27 100644
--- a/src/pages/Entry/EntryLatestBuys.vue
+++ b/src/pages/Entry/EntryLatestBuys.vue
@@ -59,7 +59,7 @@ const columns = computed(() => [
align: 'left',
},
{
- label: t('entry.latestBuys.description'),
+ label: t('globals.description'),
field: 'description',
name: 'description',
align: 'left',
@@ -214,7 +214,7 @@ const editTableCellFormFieldsOptions = [
{ field: 'grouping', label: t('entry.latestBuys.grouping') },
{ field: 'packageValue', label: t('entry.latestBuys.packageValue') },
{ field: 'weight', label: t('entry.latestBuys.weight') },
- { field: 'description', label: t('entry.latestBuys.description') },
+ { field: 'description', label: t('globals.description') },
{ field: 'size', label: t('entry.latestBuys.size') },
{ field: 'weightByPiece', label: t('entry.latestBuys.weightByPiece') },
{ field: 'packingOut', label: t('entry.latestBuys.packingOut') },
diff --git a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue
index 2a29a3d0e..f557c8ef4 100644
--- a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue
+++ b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue
@@ -174,7 +174,12 @@ async function upsert() {
@on-fetch="(data) => (userConfig = data)"
auto-load
/>
-
+
@@ -509,7 +514,7 @@ async function upsert() {
@click="inputFileRef.pickFiles()"
>
- {{ t('Select a file') }}
+ {{ t('globals.selectFile') }}
@@ -618,7 +623,7 @@ async function upsert() {
@click="inputFileRef.pickFiles()"
>
- {{ t('Select a file') }}
+ {{ t('globals.selectFile') }}
@@ -687,7 +692,6 @@ async function upsert() {
Generate identifier for original file: Generar identificador para archivo original
File: Fichero
Create document: Crear documento
- Select a file: Seleccione un fichero
Allowed content types: Tipos de archivo permitidos
The company can't be empty: La empresa no puede estar vacía
The warehouse can't be empty: El almacén no puede estar vacío
diff --git a/src/pages/Item/Card/ItemDescriptor.vue b/src/pages/Item/Card/ItemDescriptor.vue
index 362fcfc67..8c986e627 100644
--- a/src/pages/Item/Card/ItemDescriptor.vue
+++ b/src/pages/Item/Card/ItemDescriptor.vue
@@ -1,5 +1,5 @@
@@ -21,6 +25,7 @@ const $props = defineProps({
:id="$props.id"
:summary="ItemSummary"
:dated="dated"
+ :sale-fk="saleFk"
/>
diff --git a/src/pages/Order/Card/OrderSummary.vue b/src/pages/Order/Card/OrderSummary.vue
index 9b26891a1..f9704a480 100644
--- a/src/pages/Order/Card/OrderSummary.vue
+++ b/src/pages/Order/Card/OrderSummary.vue
@@ -31,7 +31,7 @@ const detailsColumns = ref([
},
{
name: 'description',
- label: t('order.summary.description'),
+ label: t('globals.description'),
field: (row) => row?.item?.name,
},
{
@@ -167,7 +167,7 @@ const detailsColumns = ref([
{{ t('order.summary.item') }}
- {{ t('order.summary.description') }}
+ {{ t('globals.description') }}
{{ t('order.summary.quantity') }}
{{ t('order.summary.price') }}
{{ t('order.summary.amount') }}
diff --git a/src/pages/Route/Card/RouteSummary.vue b/src/pages/Route/Card/RouteSummary.vue
index a10ca088e..df4495d3a 100644
--- a/src/pages/Route/Card/RouteSummary.vue
+++ b/src/pages/Route/Card/RouteSummary.vue
@@ -199,7 +199,7 @@ const openBuscaman = async (route, ticket) => {
{{ dashIfEmpty(entity?.route?.description) }}
diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue
index fe7dcee9a..f3e01d06b 100644
--- a/src/pages/Ticket/Card/TicketSummary.vue
+++ b/src/pages/Ticket/Card/TicketSummary.vue
@@ -270,7 +270,7 @@ async function changeState(value) {
{{ t('ticket.summary.visible') }}
{{ t('ticket.summary.available') }}
{{ t('ticket.summary.quantity') }}
- {{ t('ticket.summary.description') }}
+ {{ t('globals.description') }}
{{ t('ticket.summary.price') }}
{{ t('ticket.summary.discount') }}
{{ t('globals.amount') }}
@@ -425,7 +425,7 @@ async function changeState(value) {
{{ t('ticket.summary.quantity') }}
- {{ t('ticket.summary.description') }}
+ {{ t('globals.description') }}
{{ t('ticket.summary.price') }}
{{ t('ticket.summary.taxClass') }}
{{ t('globals.amount') }}
diff --git a/src/pages/Travel/Card/TravelThermographsForm.vue b/src/pages/Travel/Card/TravelThermographsForm.vue
index 6758cb6ff..4462846cb 100644
--- a/src/pages/Travel/Card/TravelThermographsForm.vue
+++ b/src/pages/Travel/Card/TravelThermographsForm.vue
@@ -300,7 +300,7 @@ const onThermographCreated = async (data) => {
-import { onMounted, ref, computed } from 'vue';
-import { QBtn, QField, QPopupEdit } from 'quasar';
+import { onMounted, ref, computed, watch } from 'vue';
+import { QBtn } from 'quasar';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
@@ -46,7 +46,12 @@ const arrayData = useArrayData('ExtraCommunity', {
},
});
-const rows = computed(() => arrayData.store.data || []);
+const rows = ref([]);
+const originalRowDataCopy = ref([]);
+const draggedRowIndex = ref(null);
+const targetRowIndex = ref(null);
+const entryRowIndex = ref(null);
+const draggedEntry = ref(null);
const tableColumnComponents = {
id: {
@@ -55,7 +60,12 @@ const tableColumnComponents = {
},
cargoSupplierNickname: {
component: QBtn,
- attrs: { flat: true, color: 'primary', dense: true },
+ attrs: {
+ flat: true,
+ color: 'primary',
+ dense: true,
+ class: 'supplier-name-button',
+ },
},
agencyModeName: {
component: 'span',
@@ -66,16 +76,24 @@ const tableColumnComponents = {
attrs: {},
},
ref: {
- component: QField,
- attrs: { readonly: true, dense: true, class: 'cursor-pointer' },
+ component: VnInput,
+ attrs: { dense: true },
+ event: (val, field, rowIndex) => ({
+ 'keyup.enter': () => saveFieldValue(val, field, rowIndex),
+ blur: () => saveFieldValue(val, field, rowIndex),
+ }),
},
stickers: {
component: 'span',
attrs: {},
},
kg: {
- component: QField,
- attrs: { readonly: true, dense: true, class: 'cursor-pointer' },
+ component: VnInput,
+ attrs: { dense: true, type: 'number', min: 0, class: 'input-number' },
+ event: (val, field, rowIndex) => ({
+ 'keyup.enter': () => saveFieldValue(val, field, rowIndex),
+ blur: () => saveFieldValue(val, field, rowIndex),
+ }),
},
loadedKg: {
component: 'span',
@@ -199,7 +217,7 @@ const columns = computed(() => [
align: 'left',
showValue: true,
sortable: true,
- format: (value) => toDate(value.substring(0, 10)),
+ format: (value) => toDate(value),
},
{
label: t('globals.wareHouseIn'),
@@ -216,7 +234,7 @@ const columns = computed(() => [
align: 'left',
showValue: true,
sortable: true,
- format: (value) => toDate(value.substring(0, 10)),
+ format: (value) => toDate(value),
},
]);
@@ -224,6 +242,22 @@ async function getData() {
await arrayData.fetch({ append: false });
}
+const onStoreDataChange = () => {
+ const newData = JSON.parse(JSON.stringify(arrayData.store.data)) || [];
+ rows.value = newData;
+ // el objetivo de esto es guardar una copia de los valores iniciales de todas las rows para corroborar si la data cambio antes de guardar los cambios
+ originalRowDataCopy.value = JSON.parse(JSON.stringify(newData));
+};
+
+watch(
+ arrayData.store,
+ () => {
+ if (!arrayData.store.data) return;
+ onStoreDataChange();
+ },
+ { deep: true, immediate: true }
+);
+
const openReportPdf = () => {
const params = {
...arrayData.store.userParams,
@@ -235,9 +269,14 @@ const openReportPdf = () => {
const saveFieldValue = async (val, field, index) => {
try {
+ // Evitar la solicitud de guardado si el valor no ha cambiado
+ if (originalRowDataCopy.value[index][field] == val) return;
+
const id = rows.value[index].id;
const params = { [field]: val };
await axios.patch(`Travels/${id}`, params);
+ // Actualizar la copia de los datos originales con el nuevo valor
+ originalRowDataCopy.value[index][field] = val;
} catch (err) {
console.error('Error updating travel');
}
@@ -248,6 +287,7 @@ const navigateToTravelId = (id) => {
};
const stopEventPropagation = (event, col) => {
+ // Detener la propagación del evento de los siguientes elementos para evitar el click sobre la row que dispararía la función navigateToTravelId
if (!['ref', 'id', 'cargoSupplierNickname', 'kg'].includes(col.name)) return;
event.preventDefault();
event.stopPropagation();
@@ -263,6 +303,121 @@ onMounted(async () => {
landedTo.value.setHours(23, 59, 59, 59);
await getData();
});
+
+// Handler del evento @dragstart (inicio del drag) y guarda información inicial
+const handleDragStart = (event, rowIndex, entryIndex) => {
+ draggedRowIndex.value = rowIndex;
+ entryRowIndex.value = entryIndex;
+ event.dataTransfer.effectAllowed = 'move';
+};
+
+// Handler del evento @dragenter (cuando haces drag sobre une elemento y lo arrastras sobre un posible target de drop) y actualiza el targetIndex
+const handleDragEnter = (_, targetIndex) => {
+ targetRowIndex.value = targetIndex;
+};
+
+const saveRowDrop = async (targetRowIndex) => {
+ const entryId = draggedEntry.value.id;
+ const travelId = rows.value[targetRowIndex].id;
+ await axios.patch(`Entries/${entryId}`, { travelFk: travelId });
+};
+
+const moveRow = async (draggedRowIndex, targetRowIndex, entryIndex) => {
+ try {
+ if (draggedRowIndex === targetRowIndex) return;
+ // Remover entry de la row original
+ draggedEntry.value = rows.value[draggedRowIndex].entries.splice(entryIndex, 1)[0];
+ //Si la row de destino por alguna razón no tiene la propiedad entry la creamos
+ if (!rows.value[targetRowIndex].entries) rows.value[targetRowIndex].entries = [];
+ // Añadir entry a la row de destino
+ rows.value[targetRowIndex].entries.push(draggedEntry.value);
+
+ await saveRowDrop(targetRowIndex);
+ } catch (err) {
+ cleanDragAndDropData();
+ console.error('Error moving row', err);
+ }
+};
+
+// Handler de cuando haces un drop tanto dentro como fuera de la tabla para limpiar acciones y data
+const handleDragEnd = () => {
+ stopScroll();
+ cleanDragAndDropData();
+};
+
+// Handler del evento @drop (cuando soltas el elemento draggeado sobre un target)
+const handleDrop = () => {
+ if (
+ !draggedRowIndex.value &&
+ draggedRowIndex.value !== 0 &&
+ !targetRowIndex.value &&
+ draggedRowIndex.value !== 0
+ )
+ return;
+ moveRow(draggedRowIndex.value, targetRowIndex.value, entryRowIndex.value);
+ handleDragEnd();
+};
+
+const cleanDragAndDropData = () => {
+ draggedRowIndex.value = null;
+ targetRowIndex.value = null;
+ entryRowIndex.value = null;
+ draggedEntry.value = null;
+};
+
+const scrollInterval = ref(null);
+
+const startScroll = (direction) => {
+ // Iniciar el scroll en la dirección especificada
+ if (!scrollInterval.value) {
+ scrollInterval.value = requestAnimationFrame(() => scroll(direction));
+ }
+};
+
+const stopScroll = () => {
+ if (scrollInterval.value) {
+ cancelAnimationFrame(scrollInterval.value);
+ scrollInterval.value = null;
+ }
+};
+
+const scroll = (direction) => {
+ // Controlar el desplazamiento en la dirección especificada
+ const yOffset = direction === 'up' ? -2 : 2;
+ window.scrollBy(0, yOffset);
+
+ const windowHeight = window.innerHeight;
+ const documentHeight = document.body.offsetHeight;
+
+ // Verificar si se alcanzaron los límites de la ventana para detener el desplazamiento
+ if (
+ (direction === 'up' && window.scrollY > 0) ||
+ (direction === 'down' && windowHeight + window.scrollY < documentHeight)
+ ) {
+ scrollInterval.value = requestAnimationFrame(() => scroll(direction));
+ } else {
+ stopScroll();
+ }
+};
+
+// Handler del scroll mientras se hace el drag de una row
+const handleDragScroll = (event) => {
+ // Obtener la posición y dimensiones del cursor
+ const y = event.clientY;
+ const windowHeight = window.innerHeight;
+
+ // Verificar si el cursor está cerca del borde superior o inferior de la ventana
+ const nearTop = y < 150;
+ const nearBottom = y > windowHeight - 100;
+
+ if (nearTop) {
+ startScroll('up');
+ } else if (nearBottom) {
+ startScroll('down');
+ } else {
+ stopScroll();
+ }
+};
@@ -302,59 +457,60 @@ onMounted(async () => {
row-key="clientId"
:pagination="{ rowsPerPage: 0 }"
class="full-width"
+ table-style="user-select: none;"
+ @drag="handleDragScroll($event)"
+ @dragend="handleDragEnd($event)"
+ :separator="!targetRowIndex && targetRowIndex !== 0 ? 'horizontal' : 'none'"
>
-
-
-
- {{ col.value }}
-
-
-
-
-
-
- {{ col.value }}
+ {{ col.value }}
-
{
+
-
+
{{ entry.id }}
@@ -381,33 +551,75 @@ onMounted(async () => {
{{ entry.supplierName }}
+
+
+ {{ toCurrency(entry.invoiceAmount) }}
+
+
+ {{ entry.reference }}
+
+
+ {{ entry.stickers }}
+
- {{ toCurrency(entry.invoiceAmount) }}
- {{ entry.reference }}
- {{ entry.stickers }}
-
- {{ entry.loadedkg }}
- {{ entry.volumeKg }}
-
-
-
-
+
+ {{ entry.loadedkg }}
+
+
+ {{ entry.volumeKg }}
+
+
+
+
+
+
+
en:
searchExtraCommunity: Search for extra community shipping
diff --git a/src/pages/Travel/ExtraCommunityFilter.vue b/src/pages/Travel/ExtraCommunityFilter.vue
index cac8e093d..0b8975165 100644
--- a/src/pages/Travel/ExtraCommunityFilter.vue
+++ b/src/pages/Travel/ExtraCommunityFilter.vue
@@ -65,7 +65,7 @@ const decrement = (paramsObj, key) => {
{{ formatFn(tag.value) }}
-
+
@@ -116,6 +116,7 @@ const decrement = (paramsObj, key) => {
{
@@ -138,8 +140,9 @@ const decrement = (paramsObj, key) => {
@@ -149,6 +152,7 @@ const decrement = (paramsObj, key) => {
{
{
{
{
-
-
en:
params:
diff --git a/src/router/modules/entry.js b/src/router/modules/entry.js
index b3ab05a08..2f6c8cb4c 100644
--- a/src/router/modules/entry.js
+++ b/src/router/modules/entry.js
@@ -11,7 +11,7 @@ export default {
redirect: { name: 'EntryMain' },
menus: {
main: ['EntryList', 'EntryLatestBuys'],
- card: ['EntryBasicData', 'EntryBuys', 'EntryNotes', 'EntryLog'],
+ card: ['EntryBasicData', 'EntryBuys', 'EntryNotes', 'EntryDms', 'EntryLog'],
},
children: [
{
@@ -95,6 +95,15 @@ export default {
},
component: () => import('src/pages/Entry/Card/EntryNotes.vue'),
},
+ {
+ path: 'dms',
+ name: 'EntryDms',
+ meta: {
+ title: 'dms',
+ icon: 'smb_share',
+ },
+ component: () => import('src/pages/Entry/Card/EntryDms.vue'),
+ },
{
path: 'log',
name: 'EntryLog',
diff --git a/test/cypress/integration/claim/claimDevelopment.spec.js b/test/cypress/integration/claim/claimDevelopment.spec.js
index 88ccbfab8..26c7ee196 100755
--- a/test/cypress/integration/claim/claimDevelopment.spec.js
+++ b/test/cypress/integration/claim/claimDevelopment.spec.js
@@ -13,7 +13,7 @@ describe('ClaimDevelopment', () => {
it('should reset line', () => {
cy.selectOption(firstLineReason, 'Novato');
cy.resetCard();
- cy.getValue(firstLineReason).should('have.value', 'Prisas');
+ cy.getValue(firstLineReason).should('equal', 'Prisas');
});
it('should edit line', () => {
@@ -23,7 +23,7 @@ describe('ClaimDevelopment', () => {
cy.login('developer');
cy.visit(`/#/claim/${claimId}/development`);
- cy.getValue(firstLineReason).should('have.value', 'Novato');
+ cy.getValue(firstLineReason).should('equal', 'Novato');
//Restart data
cy.selectOption(firstLineReason, 'Prisas');
diff --git a/test/cypress/integration/entry/entryDms.spec.js b/test/cypress/integration/entry/entryDms.spec.js
new file mode 100644
index 000000000..79a9c5162
--- /dev/null
+++ b/test/cypress/integration/entry/entryDms.spec.js
@@ -0,0 +1,41 @@
+describe('WagonTypeCreate', () => {
+ const entryId = 1;
+
+ beforeEach(() => {
+ cy.viewport(1920, 1080);
+ cy.login('developer');
+ cy.visit(`/#/entry/${entryId}/dms`);
+
+ });
+
+ it('should create edit and remove new dms', () => {
+ cy.addRow();
+ cy.get('.icon-attach').click()
+ cy.get('.q-file').selectFile('test/cypress/fixtures/image.jpg', {
+ force: true,
+ });
+
+ cy.get("tbody > tr").then((value) => {
+ //Create and check if exist new row
+ let newFileTd = Cypress.$(value).length;
+ cy.get('.q-btn--standard > .q-btn__content > .block').click();
+ expect(value).to.have.length(newFileTd++);
+ const newRowSelector = `tbody > :nth-child(${newFileTd})`
+ cy.waitForElement(newRowSelector);
+
+ //Edit new dms
+ const u = undefined;
+ cy.validateRow(newRowSelector, [u,u,u,u,'ENTRADA ID 1'])
+ cy.get(`tbody :nth-child(${newFileTd}) > .text-right > .flex > :nth-child(2) > .q-btn > .q-btn__content > .q-icon`).click();
+ })
+ // cy.log('newFileTd', newFileTd)
+
+ // //Create and check if exist new row
+ // cy.log('newFileTd:', newFileTd);
+ // cy.get(`tbody :nth-child(${newFileTd}) > .text-right > .flex > :nth-child(2) > .q-btn > .q-btn__content > .q-icon`).click()
+
+ // cy.get(`tbody :nth-child(${newFileTd}) > :nth-child(5) > .q-tr > :nth-child(1) > span`).then((value) => {
+ // cy.log(value)
+ // });
+ });
+});
diff --git a/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js b/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js
index 5024b2f1c..306c0b8c0 100644
--- a/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js
+++ b/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js
@@ -18,7 +18,7 @@ describe('InvoiceInIntrastat', () => {
cy.visit(`/#/invoice-in/1/intrastat`);
cy.getValue(firstLineCode).should(
- 'have.value',
+ 'equal',
'Plantas vivas: Esqueje/injerto, Vid'
);
});
diff --git a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
index 26c7750ad..811374b98 100644
--- a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
+++ b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
@@ -21,7 +21,7 @@ describe('InvoiceInVat', () => {
cy.saveCard();
cy.visit(`/#/invoice-in/1/vat`);
- cy.getValue(firstLineVat).should('have.value', 'H.P. IVA 21% CEE');
+ cy.getValue(firstLineVat).should('equal', 'H.P. IVA 21% CEE');
});
it('should add a new row', () => {
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index 6d627e631..f075d500f 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -42,7 +42,7 @@ Cypress.Commands.add('login', (user) => {
});
Cypress.Commands.add('waitForElement', (element) => {
- cy.get(element, { timeout: 2000 }).should('be.visible');
+ cy.get(element, { timeout: 5000 }).should('be.visible');
});
Cypress.Commands.add('getValue', (selector) => {
@@ -55,7 +55,13 @@ Cypress.Commands.add('getValue', (selector) => {
return cy.get(
selector +
'> .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > input'
- );
+ ).invoke('val')
+ }
+ // Si es un QSelect
+ if ($el.find('span').length) {
+ return cy.get(
+ selector + ' span'
+ ).then(($span) => { return $span[0].innerText })
}
// Puedes añadir un log o lanzar un error si el elemento no es reconocido
cy.log('Elemento no soportado');
@@ -126,12 +132,13 @@ Cypress.Commands.add('validateRow', (rowSelector, expectedValues) => {
cy.get(rowSelector).within(() => {
for (const [index, value] of expectedValues.entries()) {
cy.log('CHECKING ', index, value);
+ if(value === undefined) continue
if (typeof value == 'boolean') {
const prefix = value ? '' : 'not.';
cy.getValue(`:nth-child(${index + 1})`).should(`${prefix}be.checked`);
continue;
}
- cy.getValue(`:nth-child(${index + 1})`).should('have.value', value);
+ cy.getValue(`:nth-child(${index + 1})`).should('equal', value)
}
});
});