From 40425cfee218f66ae4d0b86bfabf5f73fc6fd3d0 Mon Sep 17 00:00:00 2001 From: Luis Rendon Date: Sat, 4 Nov 2023 12:05:30 -0500 Subject: [PATCH] se edito el componente RpTSegregacion para incrustar una tabla con los datos ademas de descargar. --- .../Amazon/DTO/DTOAmazonSegragacion.ts | 10 ++ .../Reportes/Segregacion/RptSegregacion.tsx | 112 ++++++++++++------ .../Amazon/Services/Amazon.Services.ts | 16 +++ 3 files changed, 102 insertions(+), 36 deletions(-) create mode 100644 src/Components/Clientes/Amazon/DTO/DTOAmazonSegragacion.ts diff --git a/src/Components/Clientes/Amazon/DTO/DTOAmazonSegragacion.ts b/src/Components/Clientes/Amazon/DTO/DTOAmazonSegragacion.ts new file mode 100644 index 0000000..c41f45f --- /dev/null +++ b/src/Components/Clientes/Amazon/DTO/DTOAmazonSegragacion.ts @@ -0,0 +1,10 @@ +export default interface DTOAmazonSegragacion { + vrid: string, + asin: string, + quantity: number, + descripcion: string, + motivo: string, + fSegregacion: string, + valorMercancia: string, + +} \ No newline at end of file diff --git a/src/Components/Clientes/Amazon/Reportes/Segregacion/RptSegregacion.tsx b/src/Components/Clientes/Amazon/Reportes/Segregacion/RptSegregacion.tsx index 73973e3..8cb2a93 100644 --- a/src/Components/Clientes/Amazon/Reportes/Segregacion/RptSegregacion.tsx +++ b/src/Components/Clientes/Amazon/Reportes/Segregacion/RptSegregacion.tsx @@ -25,6 +25,7 @@ import { AiFillFileExcel } from 'react-icons/ai' import { IconContext } from 'react-icons' import { BsChevronDown, BsChevronRight, BsFilePdfFill } from 'react-icons/bs' import { FaAmazon } from 'react-icons/fa' +import { BsSearch, BsFileEarmarkExcel } from 'react-icons/bs' import loadingImg from '../../../../../images/ajaxloader.gif' import { MFileManager } from '../../../../Utils/MFileManager/MFileManager' import DTO2096RptPayedOperations from '../../DTO/DTO2096RptPayedOperations' @@ -33,6 +34,7 @@ import IFileManager from '../../../../../Interfaces/Utils/IFileManager' import DTO2096RptFacturasPagadas from '../../DTO/DTO2096RptFacturasPagadas' import DataTable from 'react-data-table-component' import * as XLSX from 'xlsx' +import DTOAmazonSegragacion from '../../DTO/DTOAmazonSegragacion' export interface IRptSegregacionProps {} @@ -45,7 +47,7 @@ export default function RptSegregacion(props: IRptSegregacionProps) { const [Referencia, setReferencia] = useState('') const [Inicio, setInicio] = useState(currentDate()) const [Fin, setFin] = useState(currentDate()) - const [Data, setData] = useState([]) + const [Data, setData] = useState([]) const [show, setShowMsg] = useState(false) const [ShowModal, setShowModal] = useState(false) const [WaitingDialog, setWaitingDialog] = useState(false) @@ -56,61 +58,50 @@ export default function RptSegregacion(props: IRptSegregacionProps) { const [IDFactura, setIDFactura] = useState(0) const [Invoices, setInvoices] = useState([]) const msgColor = 'primary' + const columnsConcepts = [ { - name: 'Factura', - width: '350px', - selector: (row: DTO2096RptFacturasPagadas) => row.factura, + name: 'VRID', + width: '150px', + selector: (row: DTOAmazonSegragacion) => row.vrid, sortable: true }, { - name: 'Pedimento', - width: '120px', - selector: (row: DTO2096RptFacturasPagadas) => row.pedimento, + name: 'ASIN', + width: '150px', + selector: (row: DTOAmazonSegragacion) => row.asin, sortable: true }, { - name: 'Fecha pago', - width: '120px', - selector: (row: DTO2096RptFacturasPagadas) => - row.fechaPago.substring(0, 10), + name: 'Quantyty', + width: '100px', + selector: (row: DTOAmazonSegragacion) => row.quantity, sortable: true }, { - name: 'Clave', - width: '80px', - selector: (row: DTO2096RptFacturasPagadas) => row.clave, + name: 'Descripcion', + width: '250px', + selector: (row: DTOAmazonSegragacion) => row.descripcion, sortable: true }, { - name: 'Tipo Op', - width: '120px', - selector: (row: DTO2096RptFacturasPagadas) => row.tipoOp, - sortable: true - }, - { - name: 'Valor Dolares', - width: '130px', - selector: (row: DTO2096RptFacturasPagadas) => row.valorDolares, + name: 'Motivo', + width: '2100px', + + selector: (row: DTOAmazonSegragacion) => row.motivo, sortable: true }, { - name: 'Valor Aduana', - width: '130px', - selector: (row: DTO2096RptFacturasPagadas) => row.valorAduana, + name: 'FSegregacion', + width: '160px', + selector: (row: DTOAmazonSegragacion) => row.fSegregacion, sortable: true }, { - name: 'Razon Social', - width: '350px', - selector: (row: DTO2096RptFacturasPagadas) => row.razonSocial, + name: 'ValorMercancia', + width: '160px', + selector: (row: DTOAmazonSegragacion) => row.valorMercancia, sortable: true - }, - { - name: 'Aduana', - width: '550px', - selector: (row: DTO2096RptFacturasPagadas) => row.aduana, - sortable: false } ] @@ -142,6 +133,16 @@ export default function RptSegregacion(props: IRptSegregacionProps) { }) } + const loadReport = () => { + DSAmazon.GETReportesSegregadoss(Inicio, Fin) + .then((response) => { + setData(response.data) + }) + .catch((e: Error) => { + alert('Ocurrio un error' + e.message.toString()) + }) + } + return (
@@ -189,8 +190,47 @@ export default function RptSegregacion(props: IRptSegregacionProps) { downloadReport() }} > - + + + { + loadReport() + }} + > + + + + + +
+ +
+
+
diff --git a/src/Components/Clientes/Amazon/Services/Amazon.Services.ts b/src/Components/Clientes/Amazon/Services/Amazon.Services.ts index 935ffea..dc7606a 100644 --- a/src/Components/Clientes/Amazon/Services/Amazon.Services.ts +++ b/src/Components/Clientes/Amazon/Services/Amazon.Services.ts @@ -25,6 +25,7 @@ import DTO2096TraficoConsultaAmazonDetail from '../DTO/DTO2096TraficoConsultaAma import DTO2096TraficoConsultaAmazonHeader from '../DTO/DTO2096TraficoConsultaAmazonHeader' import DTO2096DataTraficoConsulta from '../DTO/DTO2096DataTraficoConsulta' import I2096CatGrupoRegulatorio from '../Interfaces/I2096CatGrupoRegulatorio' +import DTOAmazonSegragacion from '../DTO/DTOAmazonSegragacion' class AmazonDataService { AmazonPendingClasificationInvoiceGET() { @@ -197,6 +198,21 @@ class AmazonDataService { return error }) } + + + GETReportesSegregadoss(Inicio: string, Fin: string){ + return http.get(`/AmazonInvoice/GETAmazonReportesSegregadoss?Inicio=${Inicio}&Fin=${Fin}`) + + } + + + + + + + + + TraficoConsultasAmazonGenerateExcel(id: number) { return http.get(`/AmazonInvoice/TraficoConsultaAmazonGenerateExcel?id=${id}`, {responseType: 'arraybuffer'}) .then(function (response) {