diff --git a/front/odiparpack/app/containers/Odipar/Pedidos/table/CrudPedido.js b/front/odiparpack/app/containers/Odipar/Pedidos/table/CrudPedido.js
index b11881f..d1fd553 100644
--- a/front/odiparpack/app/containers/Odipar/Pedidos/table/CrudPedido.js
+++ b/front/odiparpack/app/containers/Odipar/Pedidos/table/CrudPedido.js
@@ -19,7 +19,8 @@ import {
} from '@material-ui/core';
import { anchorTable, dataApi } from './sampleData';
import FormPedido from './FormPedido';
-
+//actions
+import { setPedidos, getPedidos } from '../../../../actions/pedido';
const branch = 'crudPedido';
@@ -40,7 +41,25 @@ const styles = ({
});
class CrudPedido extends Component {
+ constructor (props) {
+ super(props)
+ this.state = {
+ dataReal: []
+ };
+
+ this.props.dispatch(getPedidos())
+ .then( res => {
+ console.log("aqui en el then ps", res)
+ this.setState({
+ dataReal: res
+ })
+ })
+ console.log("aqui en el then ps 2", this.props.pedidosLista)
+
+ }
+
render() {
+ console.log("render ps")
const {
classes,
fetchData,
@@ -56,6 +75,11 @@ class CrudPedido extends Component {
messageNotif,
title,
} = this.props;
+
+ const {dataReal} = this.state;
+ //console.log("render ps DATA", dataReal)
+ //console.log("original", dataApi)
+
return (
closeNotif(branch)} message={messageNotif} />
@@ -63,7 +87,7 @@ class CrudPedido extends Component {
({
dataTable: state.getIn([branch, 'dataTable']),
openForm: state.getIn([branch, 'showFrm']),
messageNotif: state.getIn([branch, 'notifMsg']),
+ pedidosLista : state.getIn(['pedido','pedidos']),
});
const mapDispatchToProps = dispatch => ({
@@ -122,6 +147,7 @@ const mapDispatchToProps = dispatch => ({
removeRow: bindActionCreators(removeAction, dispatch),
editRow: bindActionCreators(editAction, dispatch),
closeNotif: bindActionCreators(closeNotifAction, dispatch),
+ dispatch
});
const CrudPedidoMapped = connect(
diff --git a/front/odiparpack/app/containers/Odipar/Pedidos/table/sampleData.js b/front/odiparpack/app/containers/Odipar/Pedidos/table/sampleData.js
index 2e2b003..e16f7cc 100644
--- a/front/odiparpack/app/containers/Odipar/Pedidos/table/sampleData.js
+++ b/front/odiparpack/app/containers/Odipar/Pedidos/table/sampleData.js
@@ -4,10 +4,10 @@ export const anchorTable = [
label: 'Id',
initialValue: '',
hidden: true,
- type: 'texto'
}, {
name: 'cantidad',
label: 'Cantidad',
+ initialValue: 0,
width: 'auto',
hidden: false,
type: 'texto'
@@ -21,28 +21,28 @@ export const anchorTable = [
}, {
name: 'origen',
label: 'Origen',
- initialValue: 'option1',
+ initialValue: 'Lima',
width: 'auto',
hidden: false,
type: 'texto'
}, {
name: 'destino',
label: 'Destino',
- initialValue: 'option1',
+ initialValue: 'Lima',
width: 'auto',
hidden: false,
type: 'texto'
}, {
name: 'plazo_entrega',
label: 'Plazo de entrega',
- initialValue: true,
+ initialValue: 'aja',
width: 'auto',
hidden: false,
type: 'texto'
}, {
name: 'nombre',
label: 'Cliente',
- initialValue: true,
+ initialValue: null,
width: 'auto',
hidden: false,
type: 'texto'
@@ -53,7 +53,8 @@ export const anchorTable = [
width: 'auto',
hidden: false,
type: 'etiq_pedido'
- }, {
+ },
+ {
name: 'action',
label: 'Action',
initialValue: '',
@@ -65,8 +66,9 @@ export const dataApi = [
{
id: '1',
cantidad: 30,
- fecha: '24/05/2022 11:28 AM',
+
origen: 'Arequipa',
+ fecha: '24/05/2022 11:28 AM',
destino: 'Cuzco',
plazo_entrega: '24 horas',
nombre: 'Juan',
--
cgit v1.2.3