|
@@ -113,6 +113,13 @@ const ProductoDetalle = () => {
|
|
|
/>
|
|
|
}
|
|
|
|
|
|
+ const handleKeyPress = (event) => {
|
|
|
+ const charCode = event.which ? event.which : event.keyCode;
|
|
|
+ if (charCode < 48 || charCode > 57) {
|
|
|
+ event.preventDefault();
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
return (
|
|
|
<Form
|
|
|
layout="vertical"
|
|
@@ -125,7 +132,7 @@ const ProductoDetalle = () => {
|
|
|
<Col span={24}>
|
|
|
<h2>Información del Producto</h2>
|
|
|
</Col>
|
|
|
- <Col md={8} xs={24}>
|
|
|
+ <Col md={8} xs={12}>
|
|
|
<Form.Item
|
|
|
label="Nombre"
|
|
|
name="nombre"
|
|
@@ -136,6 +143,17 @@ const ProductoDetalle = () => {
|
|
|
<Input />
|
|
|
</Form.Item>
|
|
|
</Col>
|
|
|
+ <Col md={8} xs={12}>
|
|
|
+ <Form.Item
|
|
|
+ label="ID Sagarhpa"
|
|
|
+ name="idSagarhpa"
|
|
|
+ rules={[
|
|
|
+ commonRules.requerido,
|
|
|
+ ]}
|
|
|
+ >
|
|
|
+ <Input onKeyPress={handleKeyPress} maxLength={10}/>
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
<Col span={24}>
|
|
|
<h2>Subproductos:</h2>
|
|
|
</Col>
|
|
@@ -145,15 +163,15 @@ const ProductoDetalle = () => {
|
|
|
<>
|
|
|
{fields.map(({ key, name, ...restField }) => (
|
|
|
<Space key={key} style={{ display: 'flex', marginBottom: 8 }} align="baseline">
|
|
|
- <Form.Item
|
|
|
- {...restField}
|
|
|
- name={[name, 'nombre']}
|
|
|
- rules={[commonRules.requerido]}
|
|
|
- style={{ width: '350px' }}
|
|
|
- >
|
|
|
- <Input placeholder="Nombre del Subproducto"/>
|
|
|
- </Form.Item>
|
|
|
- <MinusCircleOutlined onClick={() => remove(name)} />
|
|
|
+ <Form.Item
|
|
|
+ {...restField}
|
|
|
+ name={[name, 'nombre']}
|
|
|
+ rules={[commonRules.requerido]}
|
|
|
+ style={{ width: '350px' }}
|
|
|
+ >
|
|
|
+ <Input placeholder="Nombre del Subproducto" />
|
|
|
+ </Form.Item>
|
|
|
+ <MinusCircleOutlined onClick={() => remove(name)} />
|
|
|
</Space>
|
|
|
))}
|
|
|
<Form.Item>
|