summaryrefslogtreecommitdiffstats
path: root/front/odiparpack/app/containers
diff options
context:
space:
mode:
authorDayana31 <[email protected]>2022-06-01 16:43:23 -0500
committerDayana31 <[email protected]>2022-06-01 16:43:23 -0500
commitec0c33156713e51c64f2a9de4f932cd5507c654b (patch)
treecc46421686a49bbc0a0c343e460c13a21af1015d /front/odiparpack/app/containers
parent6971201caffc2fccee5bfb12e88e5510c85eeb49 (diff)
parente9cb09907f8dbc9a4a64549a3ea4d1d8313e7c25 (diff)
downloadDP1_project-ec0c33156713e51c64f2a9de4f932cd5507c654b.tar.gz
DP1_project-ec0c33156713e51c64f2a9de4f932cd5507c654b.tar.bz2
DP1_project-ec0c33156713e51c64f2a9de4f932cd5507c654b.zip
Merge branch 'develop' into dayana
Diffstat (limited to 'front/odiparpack/app/containers')
-rw-r--r--front/odiparpack/app/containers/App/Application.js7
-rw-r--r--front/odiparpack/app/containers/App/index.js60
-rw-r--r--front/odiparpack/app/containers/Odipar/Almacen/Almacenes.js66
-rw-r--r--front/odiparpack/app/containers/Odipar/Almacen/table/CrudAlmacen.js148
-rw-r--r--front/odiparpack/app/containers/Odipar/Almacen/table/FormAlmacen.js124
-rw-r--r--front/odiparpack/app/containers/Odipar/Almacen/table/dataAlmacen.js75
-rw-r--r--front/odiparpack/app/containers/Odipar/Almacen/table/index.js1
-rw-r--r--front/odiparpack/app/containers/Odipar/Pedidos/Pedidos.js73
-rw-r--r--front/odiparpack/app/containers/Odipar/Pedidos/table/CrudPedido.js149
-rw-r--r--front/odiparpack/app/containers/Odipar/Pedidos/table/FormPedido.js186
-rw-r--r--front/odiparpack/app/containers/Odipar/Pedidos/table/index.js1
-rw-r--r--front/odiparpack/app/containers/Odipar/Pedidos/table/sampleData.js90
-rw-r--r--front/odiparpack/app/containers/Tables/demos/sampleData.js27
-rw-r--r--front/odiparpack/app/containers/Templates/Dashboard.js2
-rw-r--r--front/odiparpack/app/containers/Templates/appStyles-jss.js2
-rw-r--r--front/odiparpack/app/containers/pageListAsync.js14
16 files changed, 1012 insertions, 13 deletions
diff --git a/front/odiparpack/app/containers/App/Application.js b/front/odiparpack/app/containers/App/Application.js
index 0a3ffc2..8a30720 100644
--- a/front/odiparpack/app/containers/App/Application.js
+++ b/front/odiparpack/app/containers/App/Application.js
@@ -25,7 +25,9 @@ import {
Profile, BlankPage,
Photos, Error, Settings,
HelpSupport, MapMarker, MapDirection, SearchMap,
- TrafficIndicator, StreetViewMap, NotFound
+ TrafficIndicator, StreetViewMap, NotFound,
+ Pedidos,
+ Almacenes
} from '../pageListAsync';
function Application(props) {
@@ -36,6 +38,9 @@ function Application(props) {
<Switch>
<Route exact path="/app" component={DashboardV1} />
<Route exact path="/app/dashboard-v2" component={DashboardV2} />
+ {/* Pedidos */}
+ <Route exact path="/app/pedidos" component={Pedidos}/>
+ <Route exact path="/app/almacenes" component={Almacenes}/>
{ /* Layout */ }
<Route exact path="/app/layouts" component={Parent} />
<Route path="/app/layouts/grid" component={Grid} />
diff --git a/front/odiparpack/app/containers/App/index.js b/front/odiparpack/app/containers/App/index.js
index a7313fe..ea78618 100644
--- a/front/odiparpack/app/containers/App/index.js
+++ b/front/odiparpack/app/containers/App/index.js
@@ -5,11 +5,51 @@ import Auth from './Auth';
import Application from './Application';
import LoginDedicated from '../Pages/Standalone/LoginDedicated';
import ThemeWrapper from './ThemeWrapper';
+import { Snackbar, Button, Icon } from '@material-ui/core';
+import { connect } from 'react-redux';
window.__MUI_USE_NEXT_TYPOGRAPHY_VARIANTS__ = true;
-function App() {
+function App(props) {
+
+ const handleMessageClose = () => {
+ props.dispatch(closeMessage())
+ }
+
+ const {
+ openMessage = false,
+ message = '',
+ type = 'error'
+ } = props
+
return (
<ThemeWrapper>
+ <Snackbar
+ anchorOrigin={{
+ vertical: 'top',
+ horizontal: 'right',
+ }}
+ open={openMessage}
+ autoHideDuration={6000}
+ onClose={handleMessageClose}
+ message={
+ <div className="center-aligned-child">
+ <Icon style={{
+ fontSize: 20,
+ marginRight: 15
+ }} >
+ {type === 'success' ? 'check_circle' : 'report_problem'}
+ </Icon>
+ {message}
+ </div>
+ }
+ action={[
+ <Button key="undo" color="secondary" size="small" onClick={handleMessageClose}>
+ <Icon>
+ {'close'}
+ </Icon>
+ </Button>
+ ]}
+ />
<Switch>
<Route path="/" exact component={LoginDedicated} />
<Route path="/app" component={Application} />
@@ -20,4 +60,20 @@ function App() {
);
}
-export default App;
+const reducer = 'message';
+const mapStateToProps = state => ({
+ force: state, // force state from reducer
+ message: state.getIn([reducer, 'message']),
+ type: state.getIn([reducer, 'type']),
+ openMessage: state.getIn([reducer, 'openMessage'])
+});
+
+const mapDispatchToProps = dispatch => ({
+ dispatch: dispatch
+});
+const AppMapped = connect(
+ mapStateToProps,
+ mapDispatchToProps
+)(App);
+
+export default AppMapped;
diff --git a/front/odiparpack/app/containers/Odipar/Almacen/Almacenes.js b/front/odiparpack/app/containers/Odipar/Almacen/Almacenes.js
new file mode 100644
index 0000000..31a3039
--- /dev/null
+++ b/front/odiparpack/app/containers/Odipar/Almacen/Almacenes.js
@@ -0,0 +1,66 @@
+import React, { Component } from 'react';
+import { withStyles } from '@material-ui/core/styles';
+import PropTypes from 'prop-types';
+import { CrudAlmacen } from './table'
+import { Paper, Typography } from '@material-ui/core';
+import { connect } from 'react-redux';
+
+//actions
+import { getAlmacenes } from '../../../actions/almacen';
+
+const styles = ({
+ root: {
+ flexGrow: 1,
+ marginTop: 30,
+ }
+ });
+
+class Almacenes extends Component {
+ constructor (props) {
+ super(props)
+ this.state = {
+ dataRealF: []
+ };
+ this.props.dispatch(getAlmacenes()).then((res) => {
+ if (res) {
+ this.setState({
+ dataRealF: res.data,
+ });
+ }
+ })
+ //console.log("Pedido - LUEGO DE THEN ", this.state.dataRealF)
+ }
+
+
+ render() {
+ const {dataRealF} = this.state;
+ //console.log ("aNTESZSSSS?")
+ const { classes } = this.props;
+ return (
+ <div>
+ <Typography variant="h4">
+ {`Almacenes`}
+ </Typography>
+ <div>
+ <Paper className={classes.root}>
+ <CrudAlmacen title = "Lista de Almacenes" dataReal={dataRealF}/>
+ </Paper>
+ </div>
+ </div>
+ );
+ }
+}
+
+Almacenes.propTypes = {
+ classes: PropTypes.object.isRequired,
+};
+
+const mapDispatchToProps = dispatch => ({
+ dispatch
+});
+
+const AlmacenesMapped = connect(
+ mapDispatchToProps
+)(Almacenes);
+
+export default withStyles(styles)(AlmacenesMapped); \ No newline at end of file
diff --git a/front/odiparpack/app/containers/Odipar/Almacen/table/CrudAlmacen.js b/front/odiparpack/app/containers/Odipar/Almacen/table/CrudAlmacen.js
new file mode 100644
index 0000000..887d603
--- /dev/null
+++ b/front/odiparpack/app/containers/Odipar/Almacen/table/CrudAlmacen.js
@@ -0,0 +1,148 @@
+import React, { Component } from 'react';
+import PropTypes from 'prop-types';
+import { withStyles } from '@material-ui/core/styles';
+import { connect } from 'react-redux';
+import { bindActionCreators } from 'redux';
+import {
+ fetchAction,
+ addAction,
+ closeAction,
+ submitAction,
+ removeAction,
+ editAction,
+ closeNotifAction
+} from 'ba-actions/CrudTbFrmActions';
+import { CrudTableForm, Notification } from 'ba-components';
+import {
+ Paper,
+ RadioGroup,
+} from '@material-ui/core';
+import { anchorTable, dataApi } from './dataAlmacen';
+import FormAlmacen from './FormAlmacen';
+//actions
+import { getPedidos } from '../../../../actions/pedido';
+const branch = 'crudAlmacen';
+
+const renderRadioGroup = ({ input, ...rest }) => (
+ <RadioGroup
+ {...input}
+ {...rest}
+ valueselected={input.value}
+ onChange={(event, value) => input.onChange(value)}
+ />
+);
+
+
+const styles = ({
+ root: {
+ flexGrow: 1,
+ }
+});
+
+class CrudAlmacen extends Component {
+ render() {
+ //console.log("render ps")
+ const {
+ classes,
+ fetchData,
+ addNew,
+ closeForm,
+ submit,
+ removeRow,
+ editRow,
+ dataTable,
+ openForm,
+ initValues,
+ closeNotif,
+ messageNotif,
+ title,
+ dataReal,
+ dispatch,
+ editingId
+ } = this.props;
+
+ //console.log("render ps DATA", dataReal)
+ //console.log("original", dataApi)
+ //console.log("original", anchorTable)
+
+ return (
+ <div>
+ <Notification close={() => closeNotif(branch)} variant = "success" message={messageNotif} />
+ <Paper className={classes.root}>
+ <CrudTableForm
+ dataTable={dataTable}
+ openForm={openForm}
+ dataInit={dataReal}
+ anchor={anchorTable}
+ title={title}
+ fetchData={fetchData}
+ addNew={addNew}
+ closeForm={closeForm}
+ submit={submit}
+ removeRow={removeRow}
+ editRow={editRow}
+ branch={branch}
+ initValues={initValues}
+ addNewAPI={getPedidos}
+ removeRowAPI={getPedidos}
+ editRowAPI={getPedidos}
+ dispatch = {dispatch}
+ editingId = {editingId}
+ >
+ {/* Create Your own form, then arrange or custom it as You like */}
+ <FormAlmacen/>
+ {/* No need create button or submit, because that already made in this component */}
+ </CrudTableForm>
+ </Paper>
+ </div>
+ );
+ }
+}
+
+renderRadioGroup.propTypes = {
+ input: PropTypes.object.isRequired,
+};
+
+CrudAlmacen.propTypes = {
+ dataTable: PropTypes.object.isRequired,
+ openForm: PropTypes.bool.isRequired,
+ classes: PropTypes.object.isRequired,
+ fetchData: PropTypes.func.isRequired,
+ addNew: PropTypes.func.isRequired,
+ closeForm: PropTypes.func.isRequired,
+ submit: PropTypes.func.isRequired,
+ removeRow: PropTypes.func.isRequired,
+ editRow: PropTypes.func.isRequired,
+ initValues: PropTypes.object.isRequired,
+ closeNotif: PropTypes.func.isRequired,
+ messageNotif: PropTypes.string.isRequired,
+ title: PropTypes.string.isRequired,
+};
+
+
+const mapStateToProps = state => ({
+ force: state, // force state from reducer
+ initValues: state.getIn([branch, 'formValues']),
+ dataTable: state.getIn([branch, 'dataTable']),
+ openForm: state.getIn([branch, 'showFrm']),
+ messageNotif: state.getIn([branch, 'notifMsg']),
+ editingId: state.getIn([branch, 'editingId']),
+});
+
+const mapDispatchToProps = dispatch => ({
+ fetchData: bindActionCreators(fetchAction, dispatch),
+ addNew: bindActionCreators(addAction, dispatch),
+ closeForm: bindActionCreators(closeAction, dispatch),
+ submit: bindActionCreators(submitAction, dispatch),
+ removeRow: bindActionCreators(removeAction, dispatch),
+ editRow: bindActionCreators(editAction, dispatch),
+ closeNotif: bindActionCreators(closeNotifAction, dispatch),
+ dispatch
+});
+
+const CrudAlmacenMapped = connect(
+ mapStateToProps,
+ mapDispatchToProps
+)(CrudAlmacen);
+
+export default withStyles(styles)(CrudAlmacenMapped);
diff --git a/front/odiparpack/app/containers/Odipar/Almacen/table/FormAlmacen.js b/front/odiparpack/app/containers/Odipar/Almacen/table/FormAlmacen.js
new file mode 100644
index 0000000..05cfda7
--- /dev/null
+++ b/front/odiparpack/app/containers/Odipar/Almacen/table/FormAlmacen.js
@@ -0,0 +1,124 @@
+import React, { Component } from 'react';
+import { withStyles } from '@material-ui/core/styles';
+import PropTypes from 'prop-types';
+import { Field } from 'redux-form/immutable';
+import {required, integer} from 'ba-api/validation'
+import {
+ SelectRedux,
+ TextFieldRedux
+} from 'ba-components/Forms/ReduxFormMUI';
+import {
+ MenuItem,
+ InputLabel,
+ FormControl,
+ } from '@material-ui/core';
+
+const styles = ({
+ root: {
+ flexGrow: 1,
+ },
+ field: {
+ width: '100%',
+ marginBottom: 20
+ },
+ fieldBasic: {
+ width: '100%',
+ marginBottom: 20,
+ marginTop: 10
+ },
+ inlineWrap: {
+ display: 'flex',
+ flexDirection: 'row'
+ }
+ });
+
+
+class FormAlmacen extends Component {
+ saveRef = ref => {
+ this.ref = ref;
+ return this.ref;
+ };
+
+ render() {
+ const { classes } = this.props;
+ const trueBool = true;
+ return (
+ <>
+ <div>
+ <FormControl className={classes.field}>
+ <InputLabel htmlFor="selection">Tipo de Almacen</InputLabel>
+ <Field
+ name="esPrincipal"
+ component={SelectRedux}
+ placeholder="Seleccionar"
+ autoWidth={trueBool}
+ >
+ <MenuItem value={true}>Principal</MenuItem>
+ <MenuItem value={false}>Pequeño</MenuItem>
+ </Field>
+ </FormControl>
+ </div>
+ <div>
+ <FormControl className={classes.field}>
+ <InputLabel htmlFor="selection">Region</InputLabel>
+ <Field
+ name="region"
+ component={SelectRedux}
+ placeholder="Seleccionar"
+ autoWidth={trueBool}
+ >
+ <MenuItem value="Costa">Costa</MenuItem>
+ <MenuItem value="Sierra">Sierra</MenuItem>
+ <MenuItem value="Selva">Selva</MenuItem>
+ </Field>
+ </FormControl>
+ </div>
+ <div>
+ <FormControl className={classes.field}>
+ <InputLabel htmlFor="selection">Provincia</InputLabel>
+ <Field
+ name="provincia"
+ component={SelectRedux}
+ placeholder="Seleccionar"
+ autoWidth={trueBool}
+ >
+ <MenuItem value="Lima">Lima</MenuItem>
+ <MenuItem value="Arequipa">Arequipa</MenuItem>
+ <MenuItem value="Cuzco">Cuzco</MenuItem>
+ </Field>
+ </FormControl>
+ </div>
+ <div>
+ <Field
+ name="latitud"
+ component={TextFieldRedux}
+ placeholder="Latitud"
+ label="Latitud de Provincia"
+ validate={required}
+ disabled
+ required
+ ref={this.saveRef}
+ className={classes.field}
+ />
+ <Field
+ name="longitud"
+ component={TextFieldRedux}
+ placeholder="Longitud"
+ label="Longitud de Provincia"
+ validate={required}
+ disabled
+ required
+ ref={this.saveRef}
+ className={classes.field}
+ />
+ </div>
+ </>
+ );
+ }
+}
+
+FormAlmacen.propTypes = {
+ classes: PropTypes.object.isRequired,
+ };
+
+export default withStyles(styles)(FormAlmacen); \ No newline at end of file
diff --git a/front/odiparpack/app/containers/Odipar/Almacen/table/dataAlmacen.js b/front/odiparpack/app/containers/Odipar/Almacen/table/dataAlmacen.js
new file mode 100644
index 0000000..685df27
--- /dev/null
+++ b/front/odiparpack/app/containers/Odipar/Almacen/table/dataAlmacen.js
@@ -0,0 +1,75 @@
+export const anchorTable = [
+ {
+ name: 'id',
+ label: 'Identificador',
+ initialValue: '',
+ hidden: false,
+ type: 'texto'
+ }, {
+ name: 'esPrincipal',
+ label: 'Tipo de Almacen',
+ initialValue: true,
+ width: 'auto',
+ hidden: false,
+ type: 'etiq_alma'
+ }, {
+ name: 'region',
+ label: 'Region',
+ initialValue: 'Costa',
+ width: 'auto',
+ hidden: false,
+ type: 'texto'
+ }, {
+ name: 'provincia',
+ label: 'Provincia',
+ initialValue: 'Lima',
+ width: 'auto',
+ hidden: false,
+ type: 'texto'
+ }, {
+ name: 'latitud',
+ label: 'Latitud',
+ initialValue: 0,
+ width: 'auto',
+ hidden: false,
+ type: 'texto'
+ }, {
+ name: 'longitud',
+ label: 'Longitud',
+ initialValue: 0,
+ width: 'auto',
+ hidden: false,
+ type: 'texto'
+ },
+ {
+ name: 'action',
+ label: 'Acciones',
+ initialValue: '',
+ hidden: false
+ },
+];
+
+export const dataApi = [
+ {
+ id: '1',
+ esPrincipal: false,
+ region: 'Costa',
+ provincia: 'Arequipa',
+ latitud: 24,
+ longitud: 50,
+ estado: 0,
+ correo: '[email protected]',
+ dni: '123456'
+ }, {
+ id: '2',
+ esPrincipal: true,
+ region: 'Costa',
+ provincia: 'Lima',
+ latitud: 24,
+ longitud: 50,
+ nombre: 'Juan',
+ estado: 1,
+ correo: '[email protected]',
+ dni: '123456'
+ }
+];
diff --git a/front/odiparpack/app/containers/Odipar/Almacen/table/index.js b/front/odiparpack/app/containers/Odipar/Almacen/table/index.js
new file mode 100644
index 0000000..38d22f6
--- /dev/null
+++ b/front/odiparpack/app/containers/Odipar/Almacen/table/index.js
@@ -0,0 +1 @@
+export CrudAlmacen from "./CrudAlmacen"; \ No newline at end of file
diff --git a/front/odiparpack/app/containers/Odipar/Pedidos/Pedidos.js b/front/odiparpack/app/containers/Odipar/Pedidos/Pedidos.js
new file mode 100644
index 0000000..f617458
--- /dev/null
+++ b/front/odiparpack/app/containers/Odipar/Pedidos/Pedidos.js
@@ -0,0 +1,73 @@
+import React, { Component } from 'react';
+import { withStyles } from '@material-ui/core/styles';
+import PropTypes from 'prop-types';
+import { CrudPedido } from './table'
+import { Paper, Typography } from '@material-ui/core';
+import { connect } from 'react-redux';
+
+//actions
+import { getPedidos } from 'ba-actions/pedido';
+
+const styles = ({
+ root: {
+ flexGrow: 1,
+ marginTop: 30,
+ }
+ });
+
+class Pedidos extends Component {
+ constructor (props) {
+ super(props)
+ this.state = {
+ dataRealF: []
+ };
+ this.props.dispatch(getPedidos()).then((res) => {
+ if (res) {
+ this.setState({
+ dataRealF: res.data,
+ });
+ }
+ })
+ //console.log("Pedido - LUEGO DE THEN ", this.state.dataRealF)
+ }
+
+
+ render() {
+ const {dataRealF} = this.state;
+ //console.log ("aNTESZSSSS?", pedidosLista)
+ const { classes } = this.props;
+ return (
+ <div>
+ <Typography variant="h4">
+ {`Pedidos`}
+ </Typography>
+ <div>
+ <Paper className={classes.root}>
+ <CrudPedido title = "Historial de Pedidos" dataReal={dataRealF}/>
+ </Paper>
+ </div>
+ </div>
+ );
+ }
+}
+
+Pedidos.propTypes = {
+ classes: PropTypes.object.isRequired,
+};
+
+const reducer = 'pedido'
+const mapStateToProps = state => ({
+ force: state, // force state from reducer
+ pedidosLista : state.getIn([reducer]),
+});
+
+const mapDispatchToProps = dispatch => ({
+ dispatch
+});
+
+const PedidosMapped = connect(
+ mapStateToProps,
+ mapDispatchToProps
+)(Pedidos);
+
+export default withStyles(styles)(PedidosMapped); \ No newline at end of file
diff --git a/front/odiparpack/app/containers/Odipar/Pedidos/table/CrudPedido.js b/front/odiparpack/app/containers/Odipar/Pedidos/table/CrudPedido.js
new file mode 100644
index 0000000..c7a7a58
--- /dev/null
+++ b/front/odiparpack/app/containers/Odipar/Pedidos/table/CrudPedido.js
@@ -0,0 +1,149 @@
+import React, { Component } from 'react';
+import PropTypes from 'prop-types';
+import { withStyles } from '@material-ui/core/styles';
+import { connect } from 'react-redux';
+import { bindActionCreators } from 'redux';
+import {
+ fetchAction,
+ addAction,
+ closeAction,
+ submitAction,
+ removeAction,
+ editAction,
+ closeNotifAction
+} from 'ba-actions/CrudTbFrmActions';
+import { CrudTableForm, Notification } from 'ba-components';
+import {
+ Paper,
+ RadioGroup,
+} from '@material-ui/core';
+import { anchorTable, dataApi } from './sampleData';
+import FormPedido from './FormPedido';
+//actions
+import { getPedidos } from '../../../../actions/pedido';
+const branch = 'crudPedido';
+
+const renderRadioGroup = ({ input, ...rest }) => (
+ <RadioGroup
+ {...input}
+ {...rest}
+ valueselected={input.value}
+ onChange={(event, value) => input.onChange(value)}
+ />
+);
+
+
+const styles = ({
+ root: {
+ flexGrow: 1,
+ }
+});
+
+class CrudPedido extends Component {
+
+ render() {
+ //console.log("render ps")
+ const {
+ classes,
+ fetchData,
+ addNew,
+ closeForm,
+ submit,
+ removeRow,
+ editRow,
+ dataTable,
+ openForm,
+ initValues,
+ closeNotif,
+ messageNotif,
+ title,
+ dataReal,
+ dispatch,
+ editingId
+ } = this.props;
+
+ //console.log("render ps DATA", dataReal)
+ //console.log("original", dataApi)
+
+ return (
+ <div>
+ <Notification close={() => closeNotif(branch)} variant = "success" message={messageNotif} />
+ <Paper className={classes.root}>
+ <CrudTableForm
+ dataTable={dataTable}
+ openForm={openForm}
+ dataInit={dataReal}
+ anchor={anchorTable}
+ title={title}
+ fetchData={fetchData}
+ addNew={addNew}
+ closeForm={closeForm}
+ submit={submit}
+ removeRow={removeRow}
+ editRow={editRow}
+ branch={branch}
+ initValues={initValues}
+ addNewAPI={getPedidos}
+ removeRowAPI={getPedidos}
+ editRowAPI={getPedidos}
+ dispatch = {dispatch}
+ editingId = {editingId}
+ >
+ {/* Create Your own form, then arrange or custom it as You like */}
+ <FormPedido/>
+ {/* No need create button or submit, because that already made in this component */}
+ </CrudTableForm>
+ </Paper>
+ </div>
+ );
+ }
+}
+
+renderRadioGroup.propTypes = {
+ input: PropTypes.object.isRequired,
+};
+
+CrudPedido.propTypes = {
+ dataTable: PropTypes.object.isRequired,
+ openForm: PropTypes.bool.isRequired,
+ classes: PropTypes.object.isRequired,
+ fetchData: PropTypes.func.isRequired,
+ addNew: PropTypes.func.isRequired,
+ closeForm: PropTypes.func.isRequired,
+ submit: PropTypes.func.isRequired,
+ removeRow: PropTypes.func.isRequired,
+ editRow: PropTypes.func.isRequired,
+ initValues: PropTypes.object.isRequired,
+ closeNotif: PropTypes.func.isRequired,
+ messageNotif: PropTypes.string.isRequired,
+ title: PropTypes.string.isRequired,
+};
+
+
+const mapStateToProps = state => ({
+ force: state, // force state from reducer
+ initValues: state.getIn([branch, 'formValues']),
+ dataTable: state.getIn([branch, 'dataTable']),
+ openForm: state.getIn([branch, 'showFrm']),
+ messageNotif: state.getIn([branch, 'notifMsg']),
+ editingId: state.getIn([branch, 'editingId']),
+ pedidosLista : state.getIn(['pedido','pedidos']),
+});
+
+const mapDispatchToProps = dispatch => ({
+ fetchData: bindActionCreators(fetchAction, dispatch),
+ addNew: bindActionCreators(addAction, dispatch),
+ closeForm: bindActionCreators(closeAction, dispatch),
+ submit: bindActionCreators(submitAction, dispatch),
+ removeRow: bindActionCreators(removeAction, dispatch),
+ editRow: bindActionCreators(editAction, dispatch),
+ closeNotif: bindActionCreators(closeNotifAction, dispatch),
+ dispatch
+});
+
+const CrudPedidoMapped = connect(
+ mapStateToProps,
+ mapDispatchToProps
+)(CrudPedido);
+
+export default withStyles(styles)(CrudPedidoMapped);
diff --git a/front/odiparpack/app/containers/Odipar/Pedidos/table/FormPedido.js b/front/odiparpack/app/containers/Odipar/Pedidos/table/FormPedido.js
new file mode 100644
index 0000000..548f47b
--- /dev/null
+++ b/front/odiparpack/app/containers/Odipar/Pedidos/table/FormPedido.js
@@ -0,0 +1,186 @@
+import React, { Component } from 'react';
+import { withStyles } from '@material-ui/core/styles';
+import PropTypes from 'prop-types';
+import { Field } from 'redux-form/immutable';
+import {required, integer} from 'ba-api/validation'
+import {
+ SelectRedux,
+ TextFieldRedux,
+ DatePickerRedux,
+ EstadoRedux
+} from 'ba-components/Forms/ReduxFormMUI';
+import {
+ MenuItem,
+ InputLabel,
+ FormControl,
+ Typography,
+ } from '@material-ui/core';
+
+const styles = ({
+ root: {
+ flexGrow: 1,
+ },
+ field: {
+ width: '100%',
+ marginBottom: 20
+ },
+ fieldBasic: {
+ width: '100%',
+ marginBottom: 20,
+ marginTop: 10
+ },
+ inlineWrap: {
+ display: 'flex',
+ flexDirection: 'row'
+ }
+ });
+
+
+class FormPedido extends Component {
+ saveRef = ref => {
+ this.ref = ref;
+ return this.ref;
+ };
+
+ state = {
+ selectedDate: new Date(),
+ }
+
+ handleDateChange = (date) => {
+ this.setState({ selectedDate: date });
+ }
+ render() {
+ const { classes } = this.props;
+ const { selectedDate } = this.state;
+ const trueBool = true;
+ return (
+ <>
+ <Typography variant="h5">
+ {`Datos de Pedido`}
+ </Typography>
+ <div>
+ <Field
+ name="cantidad"
+ component={TextFieldRedux}
+ placeholder="Cantidad paquetes A"
+ label="Cantidad de Paquetes A"
+ type = {'number'}
+ validate={[required, integer]}
+ required
+ ref={this.saveRef}
+ className={classes.field}
+ />
+ </div>
+ <div>
+ <FormControl className={classes.field}>
+ <Field
+ name = "fecha"
+ component={DatePickerRedux}
+ label="Fecha de Registro"
+ readonly= {true}
+ />
+ </FormControl>
+ </div>
+ <div>
+ <InputLabel htmlFor="selection" style={{fontSize:12.5, marginBottom: 5}}>Estado</InputLabel>
+ <Field
+ name = "estado"
+ component={EstadoRedux}
+ />
+
+ </div>
+ <Typography variant="h5" style={{marginTop: 5}}>
+ {`Datos de Entrega`}
+ </Typography>
+ <div>
+ <FormControl className={classes.field}>
+ <InputLabel htmlFor="selection">Origen</InputLabel>
+ <Field
+ name="origen"
+ component={SelectRedux}
+ placeholder="Seleccionar"
+ autoWidth={trueBool}
+ >
+ <MenuItem value="Lima">Lima</MenuItem>
+ <MenuItem value="Arequipa">Arequipa</MenuItem>
+ <MenuItem value="Cuzco">Cuzco</MenuItem>
+ </Field>
+ </FormControl>
+ </div>
+ <div>
+ <FormControl className={classes.field}>
+ <InputLabel htmlFor="selection">Destino</InputLabel>
+ <Field
+ name="destino"
+ component={SelectRedux}
+ placeholder="Seleccionar"
+ autoWidth={trueBool}
+ >
+ <MenuItem value="Lima">Lima</MenuItem>
+ <MenuItem value="Arequipa">Arequipa</MenuItem>
+ <MenuItem value="Cuzco">Cuzco</MenuItem>
+ </Field>
+ </FormControl>
+ </div>
+ <div>
+ <Field
+ name="plazo_entrega"
+ component={TextFieldRedux}
+ placeholder="Plazo entrega"
+ label="Plazo de Entrega"
+ ref={this.saveRef}
+ disabled
+ className={classes.field}
+ />
+ </div>
+
+ <Typography variant="h5">
+ {`Datos de Cliente`}
+ </Typography>
+
+ <div>
+ <Field
+ name="nombre"
+ component={TextFieldRedux}
+ placeholder="Ingrese el nombre"
+ label="Nombre del Cliente"
+ validate={required}
+ required
+ ref={this.saveRef}
+ className={classes.field}
+ />
+ </div>
+ <div>
+ <Field
+ name="dni"
+ component={TextFieldRedux}
+ placeholder="Ingrese el RUC"
+ label="RUC del Cliente"
+ validate={required}
+ required
+ ref={this.saveRef}
+ className={classes.field}
+ />
+ </div>
+ <div>
+ <Field
+ name="correo"
+ component={TextFieldRedux}
+ placeholder="Ingrese el correo"
+ label="Correo del Cliente"
+ validate={required}
+ required
+ ref={this.saveRef}
+ className={classes.field}
+ />
+ </div>
+ </>
+ );
+ }
+}
+
+FormPedido.propTypes = {
+ classes: PropTypes.object.isRequired,
+ };
+
+export default withStyles(styles)(FormPedido); \ No newline at end of file
diff --git a/front/odiparpack/app/containers/Odipar/Pedidos/table/index.js b/front/odiparpack/app/containers/Odipar/Pedidos/table/index.js
new file mode 100644
index 0000000..48f7c9e
--- /dev/null
+++ b/front/odiparpack/app/containers/Odipar/Pedidos/table/index.js
@@ -0,0 +1 @@
+export CrudPedido from "./CrudPedido"; \ No newline at end of file
diff --git a/front/odiparpack/app/containers/Odipar/Pedidos/table/sampleData.js b/front/odiparpack/app/containers/Odipar/Pedidos/table/sampleData.js
new file mode 100644
index 0000000..4972669
--- /dev/null
+++ b/front/odiparpack/app/containers/Odipar/Pedidos/table/sampleData.js
@@ -0,0 +1,90 @@
+export const anchorTable = [
+ {
+ name: 'id',
+ label: 'Identificador',
+ initialValue: '',
+ hidden: false,
+ type: 'texto'
+ }, {
+ name: 'cantidad',
+ label: 'Cantidad',
+ initialValue: 0,
+ width: 'auto',
+ hidden: false,
+ type: 'texto'
+ }, {
+ name: 'fecha',
+ label: 'Fecha de pedido',
+ initialValue: new Date(),
+ width: 'auto',
+ hidden: false,
+ type: 'texto'
+ }, {
+ name: 'origen',
+ label: 'Origen',
+ initialValue: 'Lima',
+ width: 'auto',
+ hidden: false,
+ type: 'texto'
+ }, {
+ name: 'destino',
+ label: 'Destino',
+ initialValue: 'Lima',
+ width: 'auto',
+ hidden: false,
+ type: 'texto'
+ }, {
+ name: 'plazo_entrega',
+ label: 'Plazo de entrega',
+ initialValue: 'aja',
+ width: 'auto',
+ hidden: false,
+ type: 'texto'
+ }, {
+ name: 'nombre',
+ label: 'Cliente',
+ initialValue: null,
+ width: 'auto',
+ hidden: false,
+ type: 'texto'
+ }, {
+ name: 'estado',
+ label: 'Estado',
+ initialValue: 0,
+ width: 'auto',
+ hidden: false,
+ type: 'etiq_pedido'
+ },
+ {
+ name: 'action',
+ label: 'Action',
+ initialValue: '',
+ hidden: false
+ },
+];
+
+export const dataApi = [
+ {
+ id: '1',
+ cantidad: 30,
+ origen: 'Arequipa',
+ fecha: '24/05/2022 11:28 AM',
+ destino: 'Cuzco',
+ plazo_entrega: '24 horas',
+ nombre: 'Juan',
+ estado: 0,
+ correo: '[email protected]',
+ dni: '123456'
+ }, {
+ id: '2',
+ cantidad: 30,
+ fecha: '24/05/2022 10:28 AM',
+ origen: 'Lima',
+ destino: 'Cuzco',
+ plazo_entrega: '24 horas',
+ nombre: 'Juan',
+ estado: 1,
+ correo: '[email protected]',
+ dni: '123456'
+ }
+];
diff --git a/front/odiparpack/app/containers/Tables/demos/sampleData.js b/front/odiparpack/app/containers/Tables/demos/sampleData.js
index d53d8e2..c783c81 100644
--- a/front/odiparpack/app/containers/Tables/demos/sampleData.js
+++ b/front/odiparpack/app/containers/Tables/demos/sampleData.js
@@ -9,53 +9,62 @@ export const anchorTable = [
label: 'Text Field',
initialValue: null,
width: 'auto',
- hidden: false
+ hidden: false,
+ type:"texto"
}, {
name: 'email',
label: 'Email Field',
initialValue: null,
width: 'auto',
- hidden: false
+ hidden: false,
+ type:"texto"
}, {
name: 'radio',
label: 'Radio Option',
initialValue: 'option1',
width: '80',
- hidden: false
+ hidden: false,
+ type:"texto"
}, {
name: 'selection',
label: 'Selection',
initialValue: 'option1',
width: '80',
- hidden: false
+ hidden: false,
+ type:"texto"
}, {
name: 'onof',
label: 'On/Of Input',
initialValue: true,
width: '80',
- hidden: false
+ hidden: false,
+ type:"texto"
}, {
name: 'checkbox',
label: 'Checkbox',
initialValue: true,
width: '80',
- hidden: false
+ hidden: false,
+ type:"texto"
}, {
name: 'textarea',
label: 'Text Area',
initialValue: 'This is default text',
width: 'auto',
- hidden: false
+ hidden: false,
+ type:"texto"
}, {
name: 'edited',
label: '',
initialValue: '',
- hidden: true
+ hidden: true,
+ type:"texto"
}, {
name: 'action',
label: 'Action',
initialValue: '',
- hidden: false
+ hidden: false,
+ type:"texto"
},
];
diff --git a/front/odiparpack/app/containers/Templates/Dashboard.js b/front/odiparpack/app/containers/Templates/Dashboard.js
index 5f24777..f82d16d 100644
--- a/front/odiparpack/app/containers/Templates/Dashboard.js
+++ b/front/odiparpack/app/containers/Templates/Dashboard.js
@@ -66,7 +66,7 @@ function Dashboard(props) {
<main className={classNames(classes.content, !sidebarOpen && classes.contentPadding)} id="mainContent">
<div className={classes.bgbar} />
<section className={classes.mainWrap}>
- <BreadCrumb separator=" › " theme="light" location={history.location} />
+ <BreadCrumb separator=" › " theme="dark" location={history.location} />
<Fade
in={pageLoaded}
mountOnEnter
diff --git a/front/odiparpack/app/containers/Templates/appStyles-jss.js b/front/odiparpack/app/containers/Templates/appStyles-jss.js
index f9175eb..741bccf 100644
--- a/front/odiparpack/app/containers/Templates/appStyles-jss.js
+++ b/front/odiparpack/app/containers/Templates/appStyles-jss.js
@@ -52,6 +52,8 @@ const styles = theme => ({
},
mainWrap: {
position: 'relative',
+ backgroundColor: '#F1EEEE',
+ padding: 20,
marginTop: theme.spacing(6),
marginLeft: theme.spacing(1.5),
height: '100%',
diff --git a/front/odiparpack/app/containers/pageListAsync.js b/front/odiparpack/app/containers/pageListAsync.js
index feff750..14381b1 100644
--- a/front/odiparpack/app/containers/pageListAsync.js
+++ b/front/odiparpack/app/containers/pageListAsync.js
@@ -1,6 +1,20 @@
import Loadable from 'react-loadable';
import Loading from 'ba-components/Loading';
+// 2.Pedidos
+export const Pedidos = Loadable({
+ loader: () => import('./Odipar/Pedidos/Pedidos'),
+ loading: Loading,
+});
+
+// 4. Almacenes
+export const Almacenes = Loadable({
+ loader: () => import('./Odipar/Almacen/Almacenes'),
+ loading: Loading,
+});
+
+
+
// Dashboard
export const DashboardV1 = Loadable({
loader: () => import('./Dashboard/Dashboard'),