cambios docs

This commit is contained in:
2025-10-05 12:14:07 -06:00
parent 7f2066fa16
commit de9336fd81
3 changed files with 56 additions and 15 deletions

View File

@@ -362,9 +362,10 @@ export default function Documents() {
<option value="3">Pedimento Remesas</option>
<option value="4">Pedimento Acuse</option>
<option value="5">Pedimento EDocument</option>
<option value="6">Estado Pedimento</option>
<option value="7">Acuse Cove</option>
<option value="8">Cove</option>
<option value="9">Documento de digitalización</option>
<option value="10">Error</option>
</select>
</div>
@@ -414,10 +415,10 @@ export default function Documents() {
{/* Vista responsiva: tabla para desktop, cards para mobile */}
{/* Tabla para pantallas grandes */}
<div className="hidden lg:block">
<div style={{ minHeight: 'calc(6 * 56px)', maxHeight: 'calc(6 * 56px)', overflowY: currentDocuments.length > 6 ? 'auto' : 'hidden', position: 'relative' }}>
<div className="overflow-hidden shadow ring-1 ring-black ring-opacity-5 rounded-lg">
<table className="min-w-full divide-y divide-gray-300">
<thead className="bg-gray-50 sticky top-0 z-20">
<div className="bg-white rounded-lg shadow-sm border border-gray-200">
<div className="overflow-x-auto">
<table className="min-w-full divide-y divide-gray-200">
<thead className="bg-gray-50">
<tr>
<th scope="col" className="px-2 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider">
<input
@@ -458,7 +459,7 @@ export default function Documents() {
) : currentDocuments.length > 0 ? (
<>
{currentDocuments.map(doc => (
<tr key={doc.id} className="transition-all duration-200 hover:bg-blue-50 hover:shadow-lg">
<tr key={doc.id} className="transition-all duration-200 hover:bg-gradient-to-r hover:from-blue-50 hover:to-indigo-50 hover:shadow-lg">
<td className="px-2 py-2 text-center align-middle">
<input
type="checkbox"
@@ -468,7 +469,25 @@ export default function Documents() {
style={{ minWidth: '14px', minHeight: '14px' }}
/>
</td>
<td className="px-6 py-4 whitespace-nowrap align-middle font-medium text-blue-900">{doc.pedimento_numero}</td>
<td className="px-6 py-4 whitespace-nowrap align-middle">
<div className="flex items-center">
<div className="flex-shrink-0 h-10 w-10">
<div className="h-10 w-10 rounded-lg bg-blue-100 flex items-center justify-center">
<svg className="h-6 w-6 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
</div>
</div>
<div className="ml-4 font-medium text-gray-900">
<Link
to={`/expedientes/pedimento/${doc.pedimento}`}
className="hover:text-blue-600 hover:underline"
>
{doc.pedimento_numero}
</Link>
</div>
</div>
</td>
<td className="px-6 py-4 whitespace-nowrap align-middle text-gray-800">{doc.archivo ? doc.archivo.split('/').pop() : ''}</td>
<td className="px-6 py-4 whitespace-nowrap align-middle text-gray-700">{
(() => {
@@ -481,6 +500,8 @@ export default function Documents() {
case '6': return 'Estado Pedimento';
case '7': return 'Acuse Cove';
case '8': return 'Cove';
case '9': return 'Documento de digitalización';
case '10': return 'Error';
default: return doc.document_type || '';
}
@@ -490,7 +511,8 @@ export default function Documents() {
<td className="px-6 py-4 whitespace-nowrap align-middle text-gray-700">{doc.extension}</td>
<td className="px-6 py-4 whitespace-nowrap text-center align-middle">
<button
className="inline-flex items-center px-3 py-1 border border-transparent text-xs font-semibold rounded-md text-white bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-all duration-200 transform hover:scale-105 shadow"
className="group inline-flex items-center justify-center w-9 h-9 rounded-lg border transition-all duration-200 transform hover:scale-110 focus:outline-none focus:ring-2 focus:ring-offset-1 bg-blue-50 border-blue-200 hover:bg-blue-100 hover:border-blue-300 focus:ring-blue-500 cursor-pointer shadow-sm hover:shadow-md"
className="group inline-flex items-center justify-center w-9 h-9 rounded-lg border transition-all duration-200 transform hover:scale-110 focus:outline-none focus:ring-2 focus:ring-offset-1 bg-blue-50 border-blue-200 hover:bg-blue-100 hover:border-blue-300 focus:ring-blue-500 cursor-pointer shadow-sm hover:shadow-md"
title="Descargar"
onClick={async () => {
await downloadFile(
@@ -588,7 +610,13 @@ export default function Documents() {
/>
<div className="flex-1 min-w-0">
<h3 className="text-sm font-semibold text-gray-900">
Pedimento: {doc.pedimento_numero}
Pedimento:
<Link
to={`/expedientes/pedimento/c192e4b3-68b7-49fb-b600-6e5f5ae463ee`}
className="hover:text-blue-600 hover:underline ml-1"
>
{doc.pedimento_numero}
</Link>
</h3>
<p className="text-xs text-gray-500 mt-1 break-all">
{doc.archivo ? doc.archivo.split('/').pop() : ''}

View File

@@ -1981,6 +1981,8 @@ export default function PedimentoDetail() {
<option value="5">EDocument</option>
<option value="7">Acuse Cove</option>
<option value="8">Cove</option>
<option value="9">Documento de digitalización</option>
<option value="10">Error</option>
</select>
</div>

View File

@@ -1,5 +1,6 @@
import React, { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import { fetchProcesamientoPedimentos } from '../api/procesos.ts';
import { postWithAuth, putWithAuth } from '../fetchWithAuth';
const API_URL = import.meta.env.VITE_EFC_API_URL;
@@ -1157,9 +1158,14 @@ export default function Procesos() {
})()}
</td>
<td className="px-4 py-4 whitespace-nowrap align-middle text-sm text-gray-900 font-mono">
{typeof proc.pedimento === 'object' && proc.pedimento !== null
? proc.pedimento.pedimento_app || proc.pedimento.pedimento_app || JSON.stringify(proc.pedimento)
: proc.pedimento}
<Link
to={`/expedientes/pedimento/${typeof proc.pedimento === 'object' && proc.pedimento !== null ? proc.pedimento.id || proc.pedimento.pedimento_app : proc.pedimento}`}
className="hover:text-blue-600 hover:underline"
>
{typeof proc.pedimento === 'object' && proc.pedimento !== null
? proc.pedimento.pedimento_app || proc.pedimento.pedimento_app || JSON.stringify(proc.pedimento)
: proc.pedimento}
</Link>
</td>
<td className="px-4 py-4 whitespace-nowrap align-middle text-sm text-gray-700">
{proc.servicio === 1 ? 'Estado de pedimento'
@@ -1285,9 +1291,14 @@ export default function Procesos() {
<div className="flex items-center justify-between">
<span className="text-sm font-medium text-gray-600">Pedimento:</span>
<span className="text-sm font-mono text-gray-900 bg-gray-100 px-2 py-1 rounded">
{typeof proc.pedimento === 'object' && proc.pedimento !== null
? proc.pedimento.pedimento || JSON.stringify(proc.pedimento)
: proc.pedimento}
<Link
to={`/expedientes/pedimento/${typeof proc.pedimento === 'object' && proc.pedimento !== null ? proc.pedimento.id || proc.pedimento.pedimento_app : proc.pedimento}`}
className="hover:text-blue-600 hover:underline"
>
{typeof proc.pedimento === 'object' && proc.pedimento !== null
? proc.pedimento.pedimento || JSON.stringify(proc.pedimento)
: proc.pedimento}
</Link>
</span>
</div>
<div className="flex items-center justify-between">