cambios en el formulario osp: rol autoridad, campos responsable cambiados, esquema cambiado, añadida columna fecha de creacion a la tabla
This commit is contained in:
@@ -76,11 +76,10 @@ export function CreateTrainingForm({
|
||||
const [disabledMunicipality, setDisabledMunicipality] = React.useState(true);
|
||||
const [disabledParish, setDisabledParish] = React.useState(true);
|
||||
|
||||
const [coorState, setcoorState] = React.useState(0);
|
||||
const [coorMunicipality, setcoorMunicipality] = React.useState(0);
|
||||
const [disabledCoorMunicipality, setDisabledCoorMunicipality] =
|
||||
React.useState(true);
|
||||
const [disabledCoorParish, setDisabledCoorParish] = React.useState(true);
|
||||
// const [coorState, setcoorState] = React.useState(0);
|
||||
// const [coorMunicipality, setcoorMunicipality] = React.useState(0);
|
||||
// const [disabledCoorMunicipality, setDisabledCoorMunicipality] = React.useState(true);
|
||||
// const [disabledCoorParish, setDisabledCoorParish] = React.useState(true);
|
||||
|
||||
const [selectedFiles, setSelectedFiles] = React.useState<File[]>([]);
|
||||
|
||||
@@ -107,11 +106,11 @@ export function CreateTrainingForm({
|
||||
coorParish: defaultValues?.coorParish || undefined,
|
||||
coorPhone: defaultValues?.coorPhone || '',
|
||||
visitDate: formatToLocalISO(defaultValues?.visitDate),
|
||||
productiveActivity: defaultValues?.productiveActivity || '',
|
||||
productiveActivity: defaultValues?.productiveActivity || undefined,
|
||||
ecoSector: defaultValues?.ecoSector || undefined,
|
||||
productiveSector: defaultValues?.productiveSector || undefined,
|
||||
centralProductiveActivity: defaultValues?.centralProductiveActivity || '',
|
||||
mainProductiveActivity: defaultValues?.mainProductiveActivity || '',
|
||||
centralProductiveActivity: defaultValues?.centralProductiveActivity || undefined,
|
||||
mainProductiveActivity: defaultValues?.mainProductiveActivity || undefined,
|
||||
|
||||
photo1: defaultValues?.photo1 || '',
|
||||
photo2: defaultValues?.photo2 || '',
|
||||
@@ -149,9 +148,9 @@ export function CreateTrainingForm({
|
||||
generalObservations: defaultValues?.generalObservations || '',
|
||||
ospResponsibleEmail: defaultValues?.ospResponsibleEmail || '',
|
||||
paralysisReason: defaultValues?.paralysisReason || '',
|
||||
infrastructureMt2: defaultValues?.infrastructureMt2 || '',
|
||||
infrastructureMt2: defaultValues?.infrastructureMt2 || undefined,
|
||||
hasTransport: defaultValues?.hasTransport || false,
|
||||
structureType: defaultValues?.structureType || '',
|
||||
structureType: defaultValues?.structureType || undefined,
|
||||
isOpenSpace: defaultValues?.isOpenSpace || false,
|
||||
equipmentList: defaultValues?.equipmentList || [],
|
||||
productionList: defaultValues?.productionList || [],
|
||||
@@ -249,14 +248,14 @@ export function CreateTrainingForm({
|
||||
setDisabledParish(false);
|
||||
}
|
||||
|
||||
if (defaultValues.coorState) {
|
||||
setcoorState(Number(defaultValues.coorState));
|
||||
setDisabledCoorMunicipality(false);
|
||||
}
|
||||
if (defaultValues.coorMunicipality) {
|
||||
setcoorMunicipality(Number(defaultValues.coorMunicipality));
|
||||
setDisabledCoorParish(false);
|
||||
}
|
||||
// if (defaultValues.coorState) {
|
||||
// setcoorState(Number(defaultValues.coorState));
|
||||
// setDisabledCoorMunicipality(false);
|
||||
// }
|
||||
// if (defaultValues.coorMunicipality) {
|
||||
// setcoorMunicipality(Number(defaultValues.coorMunicipality));
|
||||
// setDisabledCoorParish(false);
|
||||
// }
|
||||
}
|
||||
}, [defaultValues]);
|
||||
|
||||
@@ -489,13 +488,11 @@ export function CreateTrainingForm({
|
||||
2. Datos de la Organización Socioproductiva (OSP)
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
{/* CAMBIO 1: lg:grid-cols-2 para evitar columnas estrechas en tablets */}
|
||||
<CardContent className="grid grid-cols-1 lg:grid-cols-2 gap-6 items-start">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="ospType"
|
||||
render={({ field }) => (
|
||||
/* CAMBIO 2: flex flex-col y space-y-3 para forzar separación vertical interna */
|
||||
<FormItem className="w-full flex flex-col space-y-3">
|
||||
<FormLabel className="whitespace-normal leading-tight font-semibold">
|
||||
Tipo de Organización
|
||||
@@ -1103,7 +1100,7 @@ export function CreateTrainingForm({
|
||||
name="womenCount"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Mujeres (cantidad)</FormLabel>
|
||||
<FormLabel>Mujeres (Cantidad opcional)</FormLabel>
|
||||
<FormControl>
|
||||
<Input type="number" {...field} />
|
||||
</FormControl>
|
||||
@@ -1116,7 +1113,7 @@ export function CreateTrainingForm({
|
||||
name="menCount"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Hombres (cantidad)</FormLabel>
|
||||
<FormLabel>Hombres (Cantidad opcional)</FormLabel>
|
||||
<FormControl>
|
||||
<Input type="number" {...field} />
|
||||
</FormControl>
|
||||
@@ -1155,7 +1152,7 @@ export function CreateTrainingForm({
|
||||
render={({ field }) => (
|
||||
<FormItem className="col-span-1 lg:col-span-2 flex flex-col space-y-2">
|
||||
<FormLabel>
|
||||
Coordenadas de la Ubicación (Google Maps)
|
||||
Coordenadas de la Ubicación (Google Maps. Opcional)
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
@@ -1211,7 +1208,7 @@ export function CreateTrainingForm({
|
||||
render={({ field }) => (
|
||||
<FormItem className="w-full flex flex-col space-y-2">
|
||||
<FormLabel className="font-semibold">
|
||||
Rif de la Comuna
|
||||
Rif de la Comuna (opcional)
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} value={field.value ?? ''} />
|
||||
@@ -1227,7 +1224,7 @@ export function CreateTrainingForm({
|
||||
render={({ field }) => (
|
||||
<FormItem className="w-full flex flex-col space-y-2">
|
||||
<FormLabel className="font-semibold">
|
||||
Nombre del Vocero o Vocera
|
||||
Nombre del Vocero o Vocera (opcional)
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} value={field.value ?? ''} />
|
||||
@@ -1243,7 +1240,7 @@ export function CreateTrainingForm({
|
||||
render={({ field }) => (
|
||||
<FormItem className="w-full flex flex-col space-y-2">
|
||||
<FormLabel className="font-semibold">
|
||||
Número de Teléfono del Vocero
|
||||
Número de Teléfono del Vocero (opcional)
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
@@ -1325,7 +1322,7 @@ export function CreateTrainingForm({
|
||||
render={({ field }) => (
|
||||
<FormItem className="w-full flex flex-col space-y-2">
|
||||
<FormLabel className="font-semibold">
|
||||
Rif del Consejo Comunal
|
||||
Rif del Consejo Comunal (opcional)
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} value={field.value ?? ''} />
|
||||
@@ -1341,7 +1338,7 @@ export function CreateTrainingForm({
|
||||
render={({ field }) => (
|
||||
<FormItem className="w-full flex flex-col space-y-2">
|
||||
<FormLabel className="font-semibold">
|
||||
Nombre del Vocero o Vocera
|
||||
Nombre del Vocero o Vocera (opcional)
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} value={field.value ?? ''} />
|
||||
@@ -1357,7 +1354,7 @@ export function CreateTrainingForm({
|
||||
render={({ field }) => (
|
||||
<FormItem className="w-full flex flex-col space-y-2">
|
||||
<FormLabel className="font-semibold">
|
||||
Número de Teléfono del Vocero
|
||||
Número de Teléfono del Vocero (opcional)
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
@@ -1419,9 +1416,31 @@ export function CreateTrainingForm({
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="ospResponsibleFullname"
|
||||
name="ospResponsiblePhone"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Teléfono</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
{...field}
|
||||
value={field.value ?? ''}
|
||||
placeholder="Ej. 04121234567"
|
||||
onChange={(e) => {
|
||||
const val = e.target.value.replace(/\D/g, '');
|
||||
field.onChange(val.slice(0, 11));
|
||||
}}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="ospResponsibleFullname"
|
||||
render={({ field }) => (
|
||||
<FormItem className="col-span-2">
|
||||
<FormLabel>Nombre y apellido</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
@@ -1431,7 +1450,7 @@ export function CreateTrainingForm({
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
{/* <FormField
|
||||
control={form.control}
|
||||
name="ospResponsibleRif"
|
||||
render={({ field }) => (
|
||||
@@ -1443,9 +1462,9 @@ export function CreateTrainingForm({
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
/> */}
|
||||
|
||||
<FormField
|
||||
{/* <FormField
|
||||
control={form.control}
|
||||
name="civilState"
|
||||
render={({ field }) => (
|
||||
@@ -1471,31 +1490,9 @@ export function CreateTrainingForm({
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
/> */}
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="ospResponsiblePhone"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Teléfono</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
{...field}
|
||||
value={field.value ?? ''}
|
||||
placeholder="Ej. 04121234567"
|
||||
onChange={(e) => {
|
||||
const val = e.target.value.replace(/\D/g, '');
|
||||
field.onChange(val.slice(0, 11));
|
||||
}}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
{/* <FormField
|
||||
control={form.control}
|
||||
name="ospResponsibleEmail"
|
||||
render={({ field }) => (
|
||||
@@ -1511,9 +1508,9 @@ export function CreateTrainingForm({
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
/> */}
|
||||
|
||||
<FormField
|
||||
{/* <FormField
|
||||
control={form.control}
|
||||
name="familyBurden"
|
||||
render={({ field }) => (
|
||||
@@ -1529,9 +1526,9 @@ export function CreateTrainingForm({
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
/> */}
|
||||
|
||||
<FormField
|
||||
{/* <FormField
|
||||
control={form.control}
|
||||
name="numberOfChildren"
|
||||
render={({ field }) => (
|
||||
@@ -1547,7 +1544,7 @@ export function CreateTrainingForm({
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
/> */}
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user