Skip to content

Commit

Permalink
Modificado seeder de Áreas
Browse files Browse the repository at this point in the history
  • Loading branch information
djimenezjerez committed Oct 6, 2021
1 parent 60c8d6d commit 79a13cf
Show file tree
Hide file tree
Showing 11 changed files with 201 additions and 168 deletions.
28 changes: 17 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,27 @@ Los usuarios tienen acceso a una o más funciones de los módulos listados anter
El encargado de administrar usuarios, para el caso sea el usuario que cuenta con el rol ADMINISTRADOR, es el que cuenta con la facultad de definir la sección para cada usuario usuario por medio. A cada sección se le asignó un rol predefinido:

1. La sección ADMINISTRADOR tiene asociado el rol ADMINISTRADOR
2. La sección SECRETARÍA GENERAL tiene asociado el rol RECEPCIÓN
3. La sección SECRETARÍA HACIENDA tiene asociado el rol SECRETARÍA
4. La sección RESPONSABLE DE PRESTACIONES tiene asociado el rol SECRETARÍA
5. La sección ATENCION EN PLATAFORMA tiene asociado el rol VERIFICADOR
6. La sección TESORERÍA tiene asociado el rol SECRETARÍA
7. La sección SECRETARÍA PRESIDENCIA tiene asociado el rol SECRETARÍA
8. La sección SECRETARÍA VICE PRESIDENCIA tiene asociado el rol SECRETARÍA
9. La sección SECRETARÍA PERSONAL tiene asociado el rol SECRETARÍA
10. La sección SECRETARÍA BIENESTAR SOCIAL Y VIVIENDA tiene asociado el rol SECRETARÍA
11. La sección SECRETARÍA DE EDUCACIÓN tiene asociado el rol SECRETARÍA
2. La sección PRESIDENCIA tiene asociado el rol SECRETARÍA
3. La sección VICE PRESIDENCIA tiene asociado el rol SECRETARÍA
4. La sección STRIA. RÉGIMEN INTERNO Y PERSONAL tiene asociado el rol SECRETARÍA
5. La sección SECRETARÍA HACIENDA tiene asociado el rol SECRETARÍA
6. La sección SECRETARÍA GENERAL tiene asociado el rol RECEPCIÓN
7. La sección STRIA. BIENESTAR SOCIAL Y VIVIENDA tiene asociado el rol SECRETARÍA
8. La sección STRIA. DE EDUCACIÓN Y CULTURA tiene asociado el rol SECRETARÍA
9. La sección STRIA. DE ACTAS Y DEPORTE tiene asociado el rol SECRETARÍA
10. La sección DIRECTOR ADMINISTRATIVO tiene asociado el rol SECRETARÍA
11. La sección UNIDAD DE SISTEMAS tiene asociado el rol SECRETARÍA
12. La sección UNIDAD DE ASESORÍA JURÍDICA tiene asociado el rol SECRETARÍA
13. La sección UNIDAD DE AUDITORÍA tiene asociado el rol SECRETARÍA
14. La sección RESPONSABLE DE PRESTACIONES tiene asociado el rol SECRETARÍA
15. La sección ATENCIÓN EN PLATAFORMA tiene asociado el rol VERIFICADOR
16. La sección TESORERÍA tiene asociado el rol SECRETARÍA
17. La sección STRIA. RELACIONES PUBLICAS, PRENSA Y PROPAGANDA tiene asociado el rol SECRETARÍA

## CONSIDERACIONES DE USO

* Cuando se crean usuarios el sistema asigna un nombre de usuario parcial que se valida al momento de enviar el formulario para evitar duplicidad de nombres de usuarios, sin embaro este campo es editable.
* La primera contraseña de cada usuario es el dato del documento de identidad, siendo posible el cambio de contraseña por cada usuario en la vista de PERFIL o por medio de un usuario administrador en el formulario de edición de usuarios.
* La primera contraseña de cada usuario es el dato del documento de identidad (con el Complemento Alfanumérico en Mayúsculas), siendo posible el cambio de contraseña por cada usuario en la vista de PERFIL o por medio de un usuario administrador en el formulario de edición de usuarios.
* Cuando se crean hojas de ruta el sistema asigna una hoja de ruta parcial que se valida al momento de enviar el formulario para evitar duplicidad de códigos de hojas de ruta, sin embargo este campo es editable.
* Los contadores que el sistema utiliza para generar códigos de hojas de ruta se reinician anualmente siempre y cuando el servidor tenga habilitada las tareas programadas de Cron y se hayan seguido los pasos indicados en la [documentación de Laravel](https://laravel.com/docs/8.x/scheduling#running-the-scheduler).

Expand Down
62 changes: 5 additions & 57 deletions app/Http/Controllers/ProcedureController.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,10 @@ public function receive()
public function print(FlowRequest $request, Procedure $procedure)
{
$selected_area = Area::find($request->area_id);
$areas = Area::where('group', '>', 0)->orderBy('order', 'ASC')->orderBy('name', 'ASC')->select('id', 'name', 'code', 'order')->get();
foreach ($areas as $i => $area) {
$areas[$i]->selected = ($area->id == $request->area_id);
}
try {
$procedure->detail = explode('\n', wordwrap($procedure->detail, 75, '\n'));
$data = [
Expand All @@ -417,63 +421,7 @@ public function print(FlowRequest $request, Procedure $procedure)
'border-right: none; border-left: none; text-align: start; vertical-align: top;',
'border-left: none; text-align: start; vertical-align: top;',
],
'areas' => [
[
[
'display' => 'Presidencia',
'name' => 'SECRETARÍA PRESIDENCIA',
'selected' => false,
], [
'display' => 'Vicepresidencia',
'name' => 'SECRETARÍA VICE PRESIDENCIA',
'selected' => false,
], [
'display' => 'Stria. Régimen Interno y Jefe de Personal',
'name' => 'SECRETARÍA PERSONAL',
'selected' => false,
], [
'display' => 'Stria. de Hacienda',
'name' => 'SECRETARÍA HACIENDA',
'selected' => false,
],
], [
[
'display' => 'Stria. General de Relaciones Públicas, Prensa y Propaganda',
'name' => 'SECRETARÍA GENERAL',
'selected' => false,
], [
'display' => 'Stria. de Bienestar Social y Vivienda',
'name' => 'SECRETARÍA BIENESTAR SOCIAL Y VIVIENDA',
'selected' => false,
], [
'display' => 'Stria. de Educación y Cultura',
'name' => 'SECRETARÍA DE EDUCACIÓN',
'selected' => false,
], [
'display' => 'Stria. de Actas y Deporte',
'name' => 'DESCONOCIDO 3',
'selected' => false,
],
], [
[
'display' => 'Director Administrativo',
'name' => 'DESCONOCIDO 4',
'selected' => false,
], [
'display' => 'Unidad de Sistemas',
'name' => 'DESCONOCIDO 5',
'selected' => false,
], [
'display' => 'Unidad de Asesoría Jurídica',
'name' => 'DESCONOCIDO 6',
'selected' => false,
], [
'display' => 'Unidad de Auditoría',
'name' => 'DESCONOCIDO 7',
'selected' => false,
],
],
]
'areas' => $areas->chunk(6),
];
foreach ($data['areas'] as $i => $chunk) {
foreach ($chunk as $j => $area) {
Expand Down
2 changes: 1 addition & 1 deletion app/Models/ProcedureType.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function getNextCodeAttribute()
$counter = $this->counter;
do {
$counter = $counter + 1;
$code = implode('/', ['ASCINALSS', auth()->user()->area->code, $this->code, $counter, $year]);
$code = implode('/', [auth()->user()->area->code, $this->code, $counter, $year]);
} while (Procedure::where('code', $code)->exists());
return $code;
}
Expand Down
99 changes: 68 additions & 31 deletions database/seeders/AreasSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,65 +23,101 @@ public function run()
'group' => 0,
'order' => 1000,
], [
'name' => 'SECRETARÍA GENERAL',
'code' => 'SG',
'role' => 'RECEPCIÓN',
'name' => 'PRESIDENCIA',
'code' => 'PRE',
'role' => 'SECRETARÍA',
'group' => 1,
'order' => 1,
], [
'name' => 'VICE PRESIDENCIA',
'code' => 'VPRE',
'role' => 'SECRETARÍA',
'group' => 1,
'order' => 2,
], [
'name' => 'STRIA. RÉGIMEN INTERNO Y PERSONAL',
'code' => 'SRIP',
'role' => 'SECRETARÍA',
'group' => 1,
'order' => 3,
], [
'name' => 'SECRETARÍA HACIENDA',
'code' => 'SH',
'code' => 'SHA',
'role' => 'SECRETARÍA',
'group' => 2,
'order' => 4,
], [
'name' => 'RESPONSABLE DE PRESTACIONES',
'code' => 'RP',
'role' => 'SECRETARÍA',
'group' => 2,
'name' => 'SECRETARÍA GENERAL',
'code' => 'SGE',
'role' => 'RECEPCIÓN',
'group' => 1,
'order' => 5,
], [
'name' => 'ATENCION EN PLATAFORMA',
'code' => 'AP',
'role' => 'VERIFICADOR',
'group' => 2,
'name' => 'STRIA. BIENESTAR SOCIAL Y VIVIENDA',
'code' => 'SBSV',
'role' => 'SECRETARÍA',
'group' => 1,
'order' => 6,
], [
'name' => 'TESORERÍA',
'code' => 'TE',
'name' => 'STRIA. DE EDUCACIÓN Y CULTURA',
'code' => 'SEC',
'role' => 'SECRETARÍA',
'group' => 2,
'order' => 10,
'group' => 1,
'order' => 7,
], [
'name' => 'SECRETARÍA PRESIDENCIA',
'code' => 'SPR',
'name' => 'STRIA. DE ACTAS Y DEPORTE',
'code' => 'SAD',
'role' => 'SECRETARÍA',
'group' => 1,
'order' => 7,
'order' => 8,
], [
'name' => 'SECRETARÍA VICE PRESIDENCIA',
'code' => 'SVP',
'name' => 'DIRECTOR ADMINISTRATIVO',
'code' => 'DADM',
'role' => 'SECRETARÍA',
'group' => 1,
'order' => 3,
'order' => 9,
], [
'name' => 'SECRETARÍA PERSONAL',
'code' => 'SPE',
'name' => 'UNIDAD DE SISTEMAS',
'code' => 'USIS',
'role' => 'SECRETARÍA',
'group' => 1,
'order' => 7,
'order' => 10,
], [
'name' => 'SECRETARÍA BIENESTAR SOCIAL Y VIVIENDA',
'code' => 'SBSV',
'name' => 'UNIDAD DE ASESORÍA JURÍDICA',
'code' => 'UAJ',
'role' => 'SECRETARÍA',
'group' => 1,
'order' => 8,
'order' => 11,
], [
'name' => 'SECRETARÍA DE EDUCACIÓN',
'code' => 'SE',
'name' => 'UNIDAD DE AUDITORÍA',
'code' => 'UAUD',
'role' => 'SECRETARÍA',
'group' => 1,
'order' => 9,
'order' => 12,
], [
'name' => 'RESPONSABLE DE PRESTACIONES',
'code' => 'RPRE',
'role' => 'SECRETARÍA',
'group' => 2,
'order' => 13,
], [
'name' => 'ATENCIÓN EN PLATAFORMA',
'code' => 'APL',
'role' => 'VERIFICADOR',
'group' => 2,
'order' => 14,
], [
'name' => 'TESORERÍA',
'code' => 'TES',
'role' => 'SECRETARÍA',
'group' => 2,
'order' => 15,
], [
'name' => 'STRIA. RELACIONES PUBLICAS, PRENSA Y PROPAGANDA',
'code' => 'SRPPP',
'role' => 'SECRETARÍA',
'group' => 1,
'order' => 16,
],
];

Expand All @@ -92,6 +128,7 @@ public function run()
], [
'name' => $area['name'],
'group' => $area['group'],
'order' => $area['order'],
'role_id' => $role->id,
]);
}
Expand Down
3 changes: 1 addition & 2 deletions public/mix-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
"/img/logo.png": "/img/logo.png",
"/img/logo_low.png": "/img/logo_low.png",
"/img/welcome_background.jpg": "/img/welcome_background.jpg",
"/audio/notification.mp3": "/audio/notification.mp3",
"/audio/notification.mpeg": "/audio/notification.mpeg"
"/audio/notification.mp3": "/audio/notification.mp3"
}
56 changes: 35 additions & 21 deletions resources/js/components/procedure_types/ProcedureTypesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,29 +47,43 @@
<v-container style="width: 10em;">
<v-row dense no-gutters justify="space-around">
<v-col cols="auto">
<v-btn
color="yellow"
class="py-6"
small
@click="$refs.dialogProcedureTypeForm.showDialog(item)"
>
<v-icon>
mdi-pencil
</v-icon>
</v-btn>
<v-tooltip bottom>
<template v-slot:activator="{ on, attrs }">
<v-btn
v-bind="attrs"
v-on="on"
color="yellow"
class="py-6"
small
@click="$refs.dialogProcedureTypeForm.showDialog(item)"
>
<v-icon>
mdi-pencil
</v-icon>
</v-btn>
</template>
<span>Editar trámite</span>
</v-tooltip>
</v-col>
<v-col cols="auto" v-if="item.total_procedures == 0">
<v-btn
dark
color="red"
class="py-6"
small
@click="$refs.dialogProcedureTypeDelete.showDialog(item)"
>
<v-icon>
mdi-delete
</v-icon>
</v-btn>
<v-tooltip bottom>
<template v-slot:activator="{ on, attrs }">
<v-btn
v-bind="attrs"
v-on="on"
dark
color="red"
class="py-6"
small
@click="$refs.dialogProcedureTypeDelete.showDialog(item)"
>
<v-icon>
mdi-delete
</v-icon>
</v-btn>
</template>
<span>Eliminar trámite</span>
</v-tooltip>
</v-col>
</v-row>
</v-container>
Expand Down
Loading

0 comments on commit 79a13cf

Please sign in to comment.