|
|
@ -35,10 +35,13 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { |
|
|
|
const [NoParteLOG, setNoParteLOG] = useState<I2096NoParteLog[]>([]) |
|
|
|
const [NoParteLOG, setNoParteLOG] = useState<I2096NoParteLog[]>([]) |
|
|
|
const [PaisClaves, setPaisClaves] = useState<I2096PaisClave[]>([]) |
|
|
|
const [PaisClaves, setPaisClaves] = useState<I2096PaisClave[]>([]) |
|
|
|
const [Data, setData] = useState<DTO2096PerfilesParecidos[]>([]) |
|
|
|
const [Data, setData] = useState<DTO2096PerfilesParecidos[]>([]) |
|
|
|
const [DataNoParteVerificacion, setDataNoParteVeriifcacion] = useState<DTO2096NoParteVerificacion[]>([]) |
|
|
|
const [DataNoParteVerificacion, setDataNoParteVeriifcacion] = useState< |
|
|
|
|
|
|
|
DTO2096NoParteVerificacion[] |
|
|
|
|
|
|
|
>([]) |
|
|
|
const [ShowModal, setShowModal] = useState(false) |
|
|
|
const [ShowModal, setShowModal] = useState(false) |
|
|
|
const [ShowModalLog, setShowModalLog] = useState(false) |
|
|
|
const [ShowModalLog, setShowModalLog] = useState(false) |
|
|
|
const [ShowModalNoParteVerificacion, setShowModalNoParteVerificacion] = useState(false) |
|
|
|
const [ShowModalNoParteVerificacion, setShowModalNoParteVerificacion] = |
|
|
|
|
|
|
|
useState(false) |
|
|
|
const [header, setHeader] = useState('') |
|
|
|
const [header, setHeader] = useState('') |
|
|
|
const [msgColor, setMsgColor] = useState('primary') |
|
|
|
const [msgColor, setMsgColor] = useState('primary') |
|
|
|
const [show, setShowMsg] = useState(false) |
|
|
|
const [show, setShowMsg] = useState(false) |
|
|
@ -81,12 +84,11 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { |
|
|
|
<Col> |
|
|
|
<Col> |
|
|
|
<div |
|
|
|
<div |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
cursor: 'pointer', |
|
|
|
cursor: 'pointer' |
|
|
|
}} |
|
|
|
}} |
|
|
|
onClick={() => { |
|
|
|
onClick={() => { |
|
|
|
loadDataNoParteVerificacion(row) |
|
|
|
loadDataNoParteVerificacion(row) |
|
|
|
setShowModalNoParteVerificacion(true) |
|
|
|
setShowModalNoParteVerificacion(true) |
|
|
|
|
|
|
|
|
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
|
<IconContext.Provider value={{ color: '#60DD0E', size: '30px' }}> |
|
|
|
<IconContext.Provider value={{ color: '#60DD0E', size: '30px' }}> |
|
|
@ -166,13 +168,15 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: 'UMF', |
|
|
|
name: 'UMF', |
|
|
|
width: '80px', |
|
|
|
width: '80px', |
|
|
|
selector: (row: I2096NoParte) => row.unidadMedidaFactura ? row.unidadMedidaFactura : '', |
|
|
|
selector: (row: I2096NoParte) => |
|
|
|
|
|
|
|
row.unidadMedidaFactura ? row.unidadMedidaFactura : '', |
|
|
|
sortable: true |
|
|
|
sortable: true |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: 'UMC', |
|
|
|
name: 'UMC', |
|
|
|
width: '80px', |
|
|
|
width: '80px', |
|
|
|
selector: (row: I2096NoParte) => row.unidadMedidaCOVE ? row.unidadMedidaCOVE : '', |
|
|
|
selector: (row: I2096NoParte) => |
|
|
|
|
|
|
|
row.unidadMedidaCOVE ? row.unidadMedidaCOVE : '', |
|
|
|
sortable: true |
|
|
|
sortable: true |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
@ -215,7 +219,8 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: 'Fracc Original', |
|
|
|
name: 'Fracc Original', |
|
|
|
width: '130px', |
|
|
|
width: '130px', |
|
|
|
cell: (row: I2096NoParteLog) => row.fraccionOriginal ? row.fraccionOriginal : '', |
|
|
|
cell: (row: I2096NoParteLog) => |
|
|
|
|
|
|
|
row.fraccionOriginal ? row.fraccionOriginal : '', |
|
|
|
sortable: true |
|
|
|
sortable: true |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
@ -228,7 +233,8 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: 'NICO Original', |
|
|
|
name: 'NICO Original', |
|
|
|
width: '130px', |
|
|
|
width: '130px', |
|
|
|
cell: (row: I2096NoParteLog) => row.subdivisionOriginal ? row.subdivisionOriginal : '', |
|
|
|
cell: (row: I2096NoParteLog) => |
|
|
|
|
|
|
|
row.subdivisionOriginal ? row.subdivisionOriginal : '', |
|
|
|
sortable: true, |
|
|
|
sortable: true, |
|
|
|
center: true |
|
|
|
center: true |
|
|
|
}, |
|
|
|
}, |
|
|
@ -237,7 +243,7 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { |
|
|
|
width: '250px', |
|
|
|
width: '250px', |
|
|
|
cell: (row: I2096NoParteLog) => row.descripcionAgenteAduanal, |
|
|
|
cell: (row: I2096NoParteLog) => row.descripcionAgenteAduanal, |
|
|
|
wrap: true, |
|
|
|
wrap: true, |
|
|
|
sortable: true, |
|
|
|
sortable: true |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: 'Desc Original', |
|
|
|
name: 'Desc Original', |
|
|
@ -256,7 +262,7 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: 'Usuario', |
|
|
|
name: 'Usuario', |
|
|
|
width: '300px', |
|
|
|
width: '300px', |
|
|
|
cell: (row: I2096NoParteLog) => row.sUsuario ? row.sUsuario : '', |
|
|
|
cell: (row: I2096NoParteLog) => (row.sUsuario ? row.sUsuario : ''), |
|
|
|
wrap: true, |
|
|
|
wrap: true, |
|
|
|
sortable: true |
|
|
|
sortable: true |
|
|
|
} |
|
|
|
} |
|
|
@ -294,7 +300,7 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { |
|
|
|
width: '100px', |
|
|
|
width: '100px', |
|
|
|
cell: (row: DTO2096NoParteVerificacion) => row.aduana, |
|
|
|
cell: (row: DTO2096NoParteVerificacion) => row.aduana, |
|
|
|
wrap: true, |
|
|
|
wrap: true, |
|
|
|
sortable: true, |
|
|
|
sortable: true |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: 'Pedimento', |
|
|
|
name: 'Pedimento', |
|
|
@ -305,7 +311,6 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const openLink = (item: string) => { |
|
|
|
const openLink = (item: string) => { |
|
|
|
window.open('https://www.amazon.com/dp/' + item) |
|
|
|
window.open('https://www.amazon.com/dp/' + item) |
|
|
|
} |
|
|
|
} |
|
|
@ -315,7 +320,7 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { |
|
|
|
if (Id === 0) return NoAsignado |
|
|
|
if (Id === 0) return NoAsignado |
|
|
|
else if (Data.length) { |
|
|
|
else if (Data.length) { |
|
|
|
const Usuario = Data.filter((item) => item.idUsuario === Id) |
|
|
|
const Usuario = Data.filter((item) => item.idUsuario === Id) |
|
|
|
return Usuario ? Usuario[0].nombre : NoAsignado |
|
|
|
return Usuario.length ? Usuario[0].nombre : NoAsignado |
|
|
|
} |
|
|
|
} |
|
|
|
return NoAsignado |
|
|
|
return NoAsignado |
|
|
|
} |
|
|
|
} |
|
|
@ -396,6 +401,7 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { |
|
|
|
} |
|
|
|
} |
|
|
|
AmazonDS.NoPartesGet(Search) |
|
|
|
AmazonDS.NoPartesGet(Search) |
|
|
|
.then((response) => { |
|
|
|
.then((response) => { |
|
|
|
|
|
|
|
console.log(response.data) |
|
|
|
dispatch(populateNoPartes(response.data)) |
|
|
|
dispatch(populateNoPartes(response.data)) |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch((e: Error) => { |
|
|
|
.catch((e: Error) => { |
|
|
@ -417,11 +423,23 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { |
|
|
|
AmazonDS.NoPartesUpdate(data) |
|
|
|
AmazonDS.NoPartesUpdate(data) |
|
|
|
.then((response) => { |
|
|
|
.then((response) => { |
|
|
|
dispatch(updateNoPartes(response.data)) |
|
|
|
dispatch(updateNoPartes(response.data)) |
|
|
|
|
|
|
|
setHeader('Informativo') |
|
|
|
|
|
|
|
setMsg('La informacion se guardo correctamente') |
|
|
|
|
|
|
|
setShowMsg(true) |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch((e: Error) => { |
|
|
|
.catch(function(error) { |
|
|
|
|
|
|
|
console.log(error.toJSON()) |
|
|
|
|
|
|
|
if (error.message == 'Request failed with status code 400') { |
|
|
|
|
|
|
|
setHeader('Error') |
|
|
|
|
|
|
|
setMsg('Fraccion no valida!') |
|
|
|
|
|
|
|
setShowMsg(true) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/* console.log(error.toJSON()) |
|
|
|
|
|
|
|
const errorMessage = error?.response?.data?.message |
|
|
|
|
|
|
|
const message = errorMessage |
|
|
|
setHeader('Error') |
|
|
|
setHeader('Error') |
|
|
|
setMsg('Ocurrio un error: ' + e) |
|
|
|
setMsg(message) |
|
|
|
setShowMsg(true) |
|
|
|
setShowMsg(true) */ |
|
|
|
return |
|
|
|
return |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
@ -616,26 +634,26 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { |
|
|
|
<Modal.Title>No Parte: {Parte}</Modal.Title> |
|
|
|
<Modal.Title>No Parte: {Parte}</Modal.Title> |
|
|
|
</Modal.Header> |
|
|
|
</Modal.Header> |
|
|
|
<Modal.Body> |
|
|
|
<Modal.Body> |
|
|
|
{/* <div style={{ height: '400px', overflow: 'scroll' }}> */} |
|
|
|
{/* <div style={{ height: '400px', overflow: 'scroll' }}> */} |
|
|
|
<Row style={{ paddingTop: '15px' }}> |
|
|
|
<Row style={{ paddingTop: '15px' }}> |
|
|
|
<Col xs={12}> |
|
|
|
<Col xs={12}> |
|
|
|
<DataTable |
|
|
|
<DataTable |
|
|
|
noHeader |
|
|
|
noHeader |
|
|
|
fixedHeaderScrollHeight="400px" |
|
|
|
fixedHeaderScrollHeight="400px" |
|
|
|
defaultSortFieldId={'id'} |
|
|
|
defaultSortFieldId={'id'} |
|
|
|
defaultSortAsc={true} |
|
|
|
defaultSortAsc={true} |
|
|
|
pagination |
|
|
|
pagination |
|
|
|
highlightOnHover |
|
|
|
highlightOnHover |
|
|
|
striped={true} |
|
|
|
striped={true} |
|
|
|
dense={true} |
|
|
|
dense={true} |
|
|
|
columns={colsNoPartesLOG} |
|
|
|
columns={colsNoPartesLOG} |
|
|
|
data={NoParteLOG.filter(function (el) { |
|
|
|
data={NoParteLOG.filter(function (el) { |
|
|
|
return el.id > 0 |
|
|
|
return el.id > 0 |
|
|
|
})} |
|
|
|
})} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</Col> |
|
|
|
</Col> |
|
|
|
</Row> |
|
|
|
</Row> |
|
|
|
{/* </div> */} |
|
|
|
{/* </div> */} |
|
|
|
</Modal.Body> |
|
|
|
</Modal.Body> |
|
|
|
</Modal> |
|
|
|
</Modal> |
|
|
|
|
|
|
|
|
|
|
@ -651,25 +669,25 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { |
|
|
|
<Modal.Title>No Parte: {Search}</Modal.Title> |
|
|
|
<Modal.Title>No Parte: {Search}</Modal.Title> |
|
|
|
</Modal.Header> |
|
|
|
</Modal.Header> |
|
|
|
<Modal.Body> |
|
|
|
<Modal.Body> |
|
|
|
<Row style={{ paddingTop: '15px' }}> |
|
|
|
<Row style={{ paddingTop: '15px' }}> |
|
|
|
<Col xs={12}> |
|
|
|
<Col xs={12}> |
|
|
|
<DataTable |
|
|
|
<DataTable |
|
|
|
noHeader |
|
|
|
noHeader |
|
|
|
fixedHeaderScrollHeight="400px" |
|
|
|
fixedHeaderScrollHeight="400px" |
|
|
|
defaultSortFieldId={'id'} |
|
|
|
defaultSortFieldId={'id'} |
|
|
|
defaultSortAsc={true} |
|
|
|
defaultSortAsc={true} |
|
|
|
pagination |
|
|
|
pagination |
|
|
|
highlightOnHover |
|
|
|
highlightOnHover |
|
|
|
striped={true} |
|
|
|
striped={true} |
|
|
|
dense={true} |
|
|
|
dense={true} |
|
|
|
columns={colsNoPartesVerificacion} |
|
|
|
columns={colsNoPartesVerificacion} |
|
|
|
data={DataNoParteVerificacion.filter(function (el) { |
|
|
|
data={DataNoParteVerificacion.filter(function (el) { |
|
|
|
return el |
|
|
|
return el |
|
|
|
})} |
|
|
|
})} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</Col> |
|
|
|
</Col> |
|
|
|
</Row> |
|
|
|
</Row> |
|
|
|
{/* </div> */} |
|
|
|
{/* </div> */} |
|
|
|
</Modal.Body> |
|
|
|
</Modal.Body> |
|
|
|
</Modal> |
|
|
|
</Modal> |
|
|
|
<MsgInformativo |
|
|
|
<MsgInformativo |
|
|
|