diff --git a/src/modules/rh/components/departments/DepartmentForm.vue b/src/modules/rh/components/departments/DepartmentForm.vue new file mode 100644 index 0000000..067fd5c --- /dev/null +++ b/src/modules/rh/components/departments/DepartmentForm.vue @@ -0,0 +1,113 @@ + + + + + + {{ mode === 'create' ? 'Crear Nuevo Departamento' : 'Editar Departamento' }} + + + Configure los detalles básicos para habilitar el nuevo departamento en la estructura organizacional. + + + + + + + + + Nombre del Departamento + + + + Este nombre será visible en todos los reportes de RH. + + + + + + + Descripción del Departamento + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/modules/rh/components/Departments.vue b/src/modules/rh/components/departments/Departments.vue similarity index 58% rename from src/modules/rh/components/Departments.vue rename to src/modules/rh/components/departments/Departments.vue index 11be5dd..6698c13 100644 --- a/src/modules/rh/components/Departments.vue +++ b/src/modules/rh/components/departments/Departments.vue @@ -113,15 +113,6 @@ - - - - - - @@ -156,72 +147,13 @@ - - - - - {{ dialogMode === 'create' ? 'Crear Nuevo Departamento' : 'Editar Departamento' }} - - - Configure los detalles básicos para habilitar el nuevo departamento en la estructura organizacional. - - - - - - - - - Nombre del Departamento - - - - Este nombre será visible en todos los reportes de RH. - - - - - - - Descripción del Departamento - - - - - - - - - - - - + :mode="dialogMode" + :formData="formData" + @save="saveDepartment" + @cancel="showDialog = false" + /> diff --git a/src/modules/rh/components/index.html b/src/modules/rh/components/index.html deleted file mode 100644 index 4b1c808..0000000 --- a/src/modules/rh/components/index.html +++ /dev/null @@ -1,323 +0,0 @@ - - - - - -Gestión de Puestos de Trabajo | RH Portal - - - - - - - - - - - - - - - - - -INICIO -/ -RH -/ -Puestos - - - - -search - - - -notifications - - - - -AD - - - - - - - - - -Puestos de Trabajo -Administre y organice los roles operativos y administrativos de la planta. - - -add_circle - Nuevo Puesto - - - - - -search - - - -filter_list -Filtros - - - - - - - - -Nombre del Puesto -Departamento -Descripción / Actividades -Acciones - - - - - - - - -supervisor_account - -Supervisor de Almacén - - - -LOGÍSTICA - - -Coordinar la recepción de mercancías, gestión de inventarios y despacho... - - - - -visibility - - -edit - - -delete - - - - - - - - - -precision_manufacturing - -Operario de Línea A - - - -PRODUCCIÓN - - -Operación de maquinaria de ensamblado y control de calidad primario... - - - - -visibility - - -edit - - -delete - - - - - - - - - -forklift - -Montacarguista - - - -ALMACÉN - - -Traslado de pallets a zona de racks y carga de camiones de distribución... - - - - -visibility - - -edit - - -delete - - - - - - - - - -security - -Analista de Seguridad - - - -EHS - - -Monitoreo de protocolos de seguridad e higiene industrial en planta... - - - - -visibility - - -edit - - -delete - - - - - - - - - -Mostrando 1 a 4 de 12 puestos - - -chevron_left - -1 -2 -3 - -chevron_right - - - - - - - - -work - - -Total de Puestos -12 Roles - - - - -domain - - -Departamentos Activos -5 Áreas - - - - -history - - -Última Actualización -Hoy, 09:12 AM - - - - - - - - \ No newline at end of file diff --git a/src/modules/rh/services/departments.services.ts b/src/modules/rh/services/departments.services.ts new file mode 100644 index 0000000..0300825 --- /dev/null +++ b/src/modules/rh/services/departments.services.ts @@ -0,0 +1,47 @@ + +import type { CreateDepartmentDTO, DeleteDepartmentDTO, ResponseDepartmentsDTO, UpdateDepartmentDTO } from "../types/departments.interface"; +import api from "@/services/api"; + +export class DepartmentsService { + + public async getDepartments(): Promise { + try { + const response = await api.get('/api/rh/departments'); + return response.data; + } catch (error) { + console.error('Error fetching departments:', error); + throw error; + } + } + + public async createDepartment(data: CreateDepartmentDTO): Promise { + try { + const response = await api.post('/api/rh/departments', data); + return response.data; + } catch (error) { + console.error('Error creating department:', error); + throw error; + } + } + + public async updateDepartment(id: number, data: UpdateDepartmentDTO): Promise { + try { + const response = await api.put(`/api/rh/departments/${id}`, data); + return response.data; + } catch (error) { + console.error('Error updating department:', error); + throw error; + } + } + + public async deleteDepartment(id: number): Promise { + try { + const response = await api.delete(`/api/rh/departments/${id}`); + return response.data; + } catch (error) { + console.error('Error deleting department:', error); + throw error; + } + } + +} \ No newline at end of file diff --git a/src/modules/rh/types/departments.interface.ts b/src/modules/rh/types/departments.interface.ts new file mode 100644 index 0000000..334155d --- /dev/null +++ b/src/modules/rh/types/departments.interface.ts @@ -0,0 +1,26 @@ +export interface Department { + id: number; + name: string; + description: string; + employeeCount?: number; + color?: string; + icon?: string; + created_at: Date; + updated_at: Date; + deleted_at: Date | null; +} + +export interface ResponseDepartmentsDTO { + data: Department[]; +} + +export interface DeleteDepartmentDTO { + message: string; +} + +export interface CreateDepartmentDTO { + name: string; + description: string; +} + +export interface UpdateDepartmentDTO extends Partial {} \ No newline at end of file diff --git a/src/modules/warehouse/components/WarehouseAddInventory.vue b/src/modules/warehouse/components/WarehouseAddInventory.vue index 2865517..70f5476 100644 --- a/src/modules/warehouse/components/WarehouseAddInventory.vue +++ b/src/modules/warehouse/components/WarehouseAddInventory.vue @@ -570,7 +570,7 @@ const removeProduct = (productId: number) => { @@ -659,7 +659,7 @@ const removeProduct = (productId: number) => { - + diff --git a/src/router/index.ts b/src/router/index.ts index fcbadfa..ee84fe5 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -18,7 +18,7 @@ import RoleForm from '../modules/users/components/RoleForm.vue'; import UserIndex from '../modules/users/components/UserIndex.vue'; import StoreDetails from '../modules/stores/components/StoreDetails.vue'; import Positions from '../modules/rh/components/Positions.vue'; -import Departments from '../modules/rh/components/Departments.vue'; +import Departments from '../modules/rh/components/departments/Departments.vue'; import '../modules/catalog/components/suppliers/Suppliers.vue'; import Suppliers from '../modules/catalog/components/suppliers/Suppliers.vue'; diff --git a/tsconfig.app.json b/tsconfig.app.json index 8d16e42..44b0bf6 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -3,6 +3,10 @@ "compilerOptions": { "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", "types": ["vite/client"], + "baseUrl": ".", + "paths": { + "@/*": ["./src/*"] + }, /* Linting */ "strict": true, diff --git a/vite.config.ts b/vite.config.ts index ba7add4..e1b5a74 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -3,6 +3,7 @@ import vue from "@vitejs/plugin-vue"; import tailwindcss from "@tailwindcss/vite"; import Components from 'unplugin-vue-components/vite'; import { PrimeVueResolver } from '@primevue/auto-import-resolver'; +import { fileURLToPath, URL } from 'node:url'; export default defineConfig({ plugins: [ @@ -13,5 +14,10 @@ export default defineConfig({ PrimeVueResolver() ] }) - ] + ], + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)) + } + } }); \ No newline at end of file
+ Configure los detalles básicos para habilitar el nuevo departamento en la estructura organizacional. +
+ Este nombre será visible en todos los reportes de RH. +
- Configure los detalles básicos para habilitar el nuevo departamento en la estructura organizacional. -
- Este nombre será visible en todos los reportes de RH. -
Administre y organice los roles operativos y administrativos de la planta.
Coordinar la recepción de mercancías, gestión de inventarios y despacho...
Operación de maquinaria de ensamblado y control de calidad primario...
Traslado de pallets a zona de racks y carga de camiones de distribución...
Monitoreo de protocolos de seguridad e higiene industrial en planta...
Total de Puestos
12 Roles
Departamentos Activos
5 Áreas
Última Actualización
Hoy, 09:12 AM