-
-
-
-
-
-
-
-
-
-
-
+
+
diff --git a/src/modules/fixed-assets/components/assets/FixedAssetImageCard.vue b/src/modules/fixed-assets/components/assets/FixedAssetImageCard.vue
deleted file mode 100644
index 07cca7d..0000000
--- a/src/modules/fixed-assets/components/assets/FixedAssetImageCard.vue
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
- Imagen del Activo
-
-
-
-
-
-
-
-
-
Subir Imagen
-
PNG, JPG hasta 5MB
-
-
-
- {{ form.imageFileName || 'No seleccionado' }}
-
-
-
-
-
-
-
diff --git a/src/modules/fixed-assets/components/structures/FixedAssetStructureDetails.vue b/src/modules/fixed-assets/components/structures/FixedAssetStructureDetails.vue
deleted file mode 100644
index dfc637f..0000000
--- a/src/modules/fixed-assets/components/structures/FixedAssetStructureDetails.vue
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-
-
- Detalle de Estructura de Activo
-
-
- Consulta el arbol de relacion y datos de control del activo compuesto.
-
-
-
-
-
-
- Cargando informacion de la estructura...
-
-
-
-
-
- No se encontro la estructura solicitada.
-
-
-
diff --git a/src/modules/fixed-assets/components/structures/FixedAssetStructureForm.vue b/src/modules/fixed-assets/components/structures/FixedAssetStructureForm.vue
deleted file mode 100644
index ab84393..0000000
--- a/src/modules/fixed-assets/components/structures/FixedAssetStructureForm.vue
+++ /dev/null
@@ -1,128 +0,0 @@
-
-
-
-
-
-
-
-
-
- {{ title }}
-
-
- Configure la jerarquia de activos y asigne los elementos contenidos en el contenedor principal.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Valor del Activo Padre
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/modules/fixed-assets/components/structures/FixedAssetStructuresIndex.vue b/src/modules/fixed-assets/components/structures/FixedAssetStructuresIndex.vue
deleted file mode 100644
index 95c0aba..0000000
--- a/src/modules/fixed-assets/components/structures/FixedAssetStructuresIndex.vue
+++ /dev/null
@@ -1,182 +0,0 @@
-
-
-
-
-
-
-
- Estructuras de Activos Fijos
-
-
- Define, organiza y monitorea activos compuestos.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- | Codigo |
- Estructura |
- Categoria |
- Ubicacion |
- Contenidos |
- Valor Total |
- Estatus |
- Acciones |
-
-
-
-
- |
- Cargando estructuras...
- |
-
-
- | {{ structure.code }} |
-
- {{ structure.name }}
- Serie: {{ structure.containerSerial }}
- |
- {{ structure.containerCategory }} |
- {{ structure.location }} |
- {{ structure.contents.length }} |
- {{ formatCurrency(structure.containerValue + structure.contents.reduce((sum, item) => sum + item.value, 0)) }} |
-
-
- {{ structure.status }}
-
- |
-
-
-
-
-
- |
-
-
- |
- No hay estructuras para mostrar.
- |
-
-
-
-
-
-
-
- Mostrando {{ paginatedStructures.length }} de {{ filteredStructures.length }} estructuras
-
-
-
-
-
-
-
-
diff --git a/src/modules/fixed-assets/components/structures/StructureContentsTable.vue b/src/modules/fixed-assets/components/structures/StructureContentsTable.vue
deleted file mode 100644
index 043db66..0000000
--- a/src/modules/fixed-assets/components/structures/StructureContentsTable.vue
+++ /dev/null
@@ -1,181 +0,0 @@
-
-
-
-
-
-
-
-
- Inventario de Activos Contenidos
-
-
- {{ modelValue.length }} ELEMENTOS
-
-
-
-
-
-
-
-
-
-
- Tip: puede ingresar serie o ID del activo para anexarlo rapidamente.
-
-
-
-
-
-
- | Imagen |
- Activo |
- Serie |
- Condicion |
- Valor |
- Accion |
-
-
-
-
- |
-
-
-
- |
-
- {{ asset.name }}
- {{ asset.category }}
- |
- {{ asset.serial }} |
-
-
- {{ asset.condition }}
-
- |
-
- {{ formatCurrency(asset.value) }}
- |
-
-
- |
-
-
- |
- No hay activos vinculados a la estructura.
- |
-
-
-
-
-
-
- Valor acumulado de contenidos:
- {{ formatCurrency(totalValue) }}
-
-
-
-
-
diff --git a/src/modules/fixed-assets/components/structures/StructureControlInfoCard.vue b/src/modules/fixed-assets/components/structures/StructureControlInfoCard.vue
deleted file mode 100644
index 0a5bc00..0000000
--- a/src/modules/fixed-assets/components/structures/StructureControlInfoCard.vue
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
- Informacion de Control
-
-
-
-
-
-
Estado de estructura
-
{{ structure.controlInfo.statusLabel }}
-
-
-
Fecha de creacion
-
{{ structure.controlInfo.createdAt }}
-
-
-
Responsable
-
{{ structure.controlInfo.owner }}
-
-
-
-
-
diff --git a/src/modules/fixed-assets/components/structures/StructureParentInfoCard.vue b/src/modules/fixed-assets/components/structures/StructureParentInfoCard.vue
deleted file mode 100644
index 0d2d4ba..0000000
--- a/src/modules/fixed-assets/components/structures/StructureParentInfoCard.vue
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
- Informacion del Activo Padre
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/modules/fixed-assets/components/structures/StructureValuationSummary.vue b/src/modules/fixed-assets/components/structures/StructureValuationSummary.vue
deleted file mode 100644
index f971fd5..0000000
--- a/src/modules/fixed-assets/components/structures/StructureValuationSummary.vue
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
- Resumen de valoracion
-
-
-
- Valor de contenedor
- {{ formatCurrency(structure.containerValue) }}
-
-
- Valor de contenidos ({{ structure.contents.length }})
- {{ formatCurrency(contentsTotal) }}
-
-
-
-
Valor total de estructura
-
{{ formatCurrency(totalStructureValue) }}
-
-
-
- El valor total se calcula sumando el activo base mas todos los elementos vinculados.
-
-
-
-
-
-
-
diff --git a/src/modules/fixed-assets/services/fixedAssetStructuresService.ts b/src/modules/fixed-assets/services/fixedAssetStructuresService.ts
deleted file mode 100644
index 355f305..0000000
--- a/src/modules/fixed-assets/services/fixedAssetStructuresService.ts
+++ /dev/null
@@ -1,124 +0,0 @@
-import type { FixedAssetStructure } from '../types/fixedAssetStructure';
-
-const structuresMock: FixedAssetStructure[] = [
- {
- id: '1',
- code: 'EST-0001',
- name: 'Oficina Movil Mod-01',
- containerCategory: 'Oficina Movil',
- containerSerial: 'SER-CONT-2024-001',
- location: 'Planta Norte - Sector B',
- containerValue: 12500,
- status: 'BORRADOR',
- controlInfo: {
- statusLabel: 'Borrador / En proceso',
- createdAt: '24 de Mayo, 2024',
- owner: 'Carlos Mendez'
- },
- contents: [
- {
- id: 'ACT-2001',
- name: 'Laptop Dell XPS 15',
- category: 'Equipos de Computo',
- serial: 'DELL-8829-XP',
- condition: 'EXCELENTE',
- value: 26500
- },
- {
- id: 'ACT-2002',
- name: 'Silla Ergonomica Herman Miller',
- category: 'Mobiliario de Oficina',
- serial: 'MOB-HM-7721',
- condition: 'EXCELENTE',
- value: 11900
- },
- {
- id: 'ACT-2003',
- name: 'Escritorio Ajustable Pro',
- category: 'Mobiliario de Oficina',
- serial: 'MOB-DK-4410',
- condition: 'BUENO',
- value: 11000
- }
- ]
- },
- {
- id: '2',
- code: 'EST-0002',
- name: 'Kit Punto de Venta Sucursal Centro',
- containerCategory: 'Punto de Venta',
- containerSerial: 'POS-CN-001',
- location: 'Sucursal Centro',
- containerValue: 9800,
- status: 'ACTIVA',
- controlInfo: {
- statusLabel: 'Aprobada / Activa',
- createdAt: '12 de Enero, 2025',
- owner: 'Valeria Ponce'
- },
- contents: [
- {
- id: 'ACT-3122',
- name: 'Terminal POS Verifone',
- category: 'Equipos POS',
- serial: 'POS-VERI-8891',
- condition: 'EXCELENTE',
- value: 7300
- },
- {
- id: 'ACT-3123',
- name: 'Impresora Termica Epson',
- category: 'Perifericos',
- serial: 'EPS-TM-T20',
- condition: 'BUENO',
- value: 2650
- }
- ]
- },
- {
- id: '3',
- code: 'EST-0003',
- name: 'Cabina Tecnica Almacen A',
- containerCategory: 'Infraestructura TI',
- containerSerial: 'CB-TI-004',
- location: 'Almacen General - Pasillo A',
- containerValue: 22000,
- status: 'EN_REVISION',
- controlInfo: {
- statusLabel: 'Revision Tecnica',
- createdAt: '03 de Febrero, 2026',
- owner: 'Ana Sofia Ruiz'
- },
- contents: [
- {
- id: 'ACT-4410',
- name: 'Switch Cisco 48p',
- category: 'Networking',
- serial: 'CS-48-101',
- condition: 'EXCELENTE',
- value: 15300
- },
- {
- id: 'ACT-4411',
- name: 'UPS APC 3000VA',
- category: 'Energia',
- serial: 'UPS-APC-771',
- condition: 'REGULAR',
- value: 4800
- }
- ]
- }
-];
-
-const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
-
-export const fixedAssetStructuresService = {
- async getStructures(): Promise
{
- await wait(120);
- return structuresMock;
- },
- async getStructureById(id: string): Promise {
- await wait(120);
- return structuresMock.find((structure) => structure.id === id) ?? null;
- }
-};
diff --git a/src/modules/fixed-assets/services/fixedAssetsService.ts b/src/modules/fixed-assets/services/fixedAssetsService.ts
new file mode 100644
index 0000000..3b37ddd
--- /dev/null
+++ b/src/modules/fixed-assets/services/fixedAssetsService.ts
@@ -0,0 +1,120 @@
+import api from '../../../services/api';
+
+export interface Asset {
+ id: number;
+ sku: string;
+ asset_tag: string | null;
+ status: { id: number; name: string };
+ estimated_useful_life: number | null;
+ depreciation_method: string;
+ residual_value: string;
+ accumulated_depreciation: string;
+ book_value: string;
+ warranty_days: number | null;
+ warranty_end_date: string | null;
+ inventory_warehouse: {
+ id: number;
+ product: {
+ id: number;
+ name: string;
+ serial_number?: string;
+ category?: string;
+ };
+ } | null;
+ active_assignment: {
+ id: number;
+ employee: {
+ id: number;
+ name: string;
+ department: {
+ id: number;
+ name: string;
+ } | null;
+ };
+ } | null;
+}
+
+export interface AssetsPaginatedResponse {
+ status: string;
+ data: {
+ current_page: number;
+ data: Asset[];
+ last_page: number;
+ per_page: number;
+ total: number;
+ };
+}
+
+export interface AssetsListResponse {
+ status: string;
+ data: {
+ data: Asset[];
+ };
+}
+
+export interface AssetDetailResponse {
+ status: string;
+ data: {
+ data: Asset;
+ };
+}
+
+export interface StatusOption {
+ id: number;
+ name: string;
+}
+
+export interface StatusOptionsResponse {
+ status: string;
+ data: {
+ data: StatusOption[];
+ };
+}
+
+interface AssetFilters {
+ q?: string;
+ status?: number;
+ page?: number;
+ paginate?: boolean;
+}
+
+class FixedAssetsService {
+ async getAssets(filters: AssetFilters = {}): Promise {
+ const params: Record = {};
+
+ if (filters.q) params.q = filters.q;
+ if (filters.status) params.status = filters.status;
+ if (filters.page) params.page = filters.page;
+ if (filters.paginate !== undefined) params.paginate = filters.paginate;
+
+ const response = await api.get('/api/assets', { params });
+ return response.data;
+ }
+
+ async getAsset(id: number): Promise {
+ const response = await api.get(`/api/assets/${id}`);
+ return response.data;
+ }
+
+ async createAsset(data: Record): Promise {
+ const response = await api.post('/api/assets', data);
+ return response.data;
+ }
+
+ async updateAsset(id: number, data: Record): Promise {
+ const response = await api.put(`/api/assets/${id}`, data);
+ return response.data;
+ }
+
+ async deleteAsset(id: number): Promise {
+ await api.delete(`/api/assets/${id}`);
+ }
+
+ async getStatusOptions(): Promise {
+ const response = await api.get('/api/assets/options/status');
+ return response.data.data.data;
+ }
+}
+
+export const fixedAssetsService = new FixedAssetsService();
+export default fixedAssetsService;
diff --git a/src/modules/fixed-assets/types/fixedAsset.ts b/src/modules/fixed-assets/types/fixedAsset.ts
index e24d238..38268ba 100644
--- a/src/modules/fixed-assets/types/fixedAsset.ts
+++ b/src/modules/fixed-assets/types/fixedAsset.ts
@@ -1,13 +1,24 @@
export interface FixedAssetFormData {
- name: string;
- serial: string;
- category: string;
- brand: string;
- model: string;
- purchaseDate: string;
- purchasePrice: number | null;
- initialLocation: string;
- initialStatus: string;
- responsibleEmployee: string;
- imageFileName: string;
+ inventory_warehouse_id: number | null;
+ estimated_useful_life: number | null;
+ depreciation_method: string;
+ residual_value: number | null;
+ asset_tag: string;
+ warranty_days: number | null;
+ warranty_end_date: string;
+}
+
+export interface InventoryWarehouseOption {
+ id: number;
+ serial_number: string | null;
+ quantity: number;
+ purchase_cost: number;
+ product: {
+ id: number;
+ name: string;
+ } | null;
+ warehouse: {
+ id: number;
+ name: string;
+ } | null;
}
diff --git a/src/modules/fixed-assets/types/fixedAssetStructure.ts b/src/modules/fixed-assets/types/fixedAssetStructure.ts
deleted file mode 100644
index c8c9aec..0000000
--- a/src/modules/fixed-assets/types/fixedAssetStructure.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-export type StructureStatus = 'BORRADOR' | 'ACTIVA' | 'EN_REVISION' | 'INACTIVA';
-export type ContentCondition = 'EXCELENTE' | 'BUENO' | 'REGULAR';
-
-export interface StructureContentAsset {
- id: string;
- name: string;
- category: string;
- serial: string;
- condition: ContentCondition;
- value: number;
-}
-
-export interface StructureControlInfo {
- statusLabel: string;
- createdAt: string;
- owner: string;
-}
-
-export interface FixedAssetStructure {
- id: string;
- code: string;
- name: string;
- containerCategory: string;
- containerSerial: string;
- location: string;
- containerValue: number;
- status: StructureStatus;
- controlInfo: StructureControlInfo;
- contents: StructureContentAsset[];
-}
diff --git a/src/router/index.ts b/src/router/index.ts
index 3ae6d0c..e703453 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -17,9 +17,6 @@ import FixedAssetForm from '../modules/fixed-assets/components/assets/FixedAsset
import FixedAssetAssignmentsIndex from '../modules/fixed-assets/components/assignments/FixedAssetAssignmentsIndex.vue';
import FixedAssetAssignmentForm from '../modules/fixed-assets/components/assignments/FixedAssetAssignmentForm.vue';
import FixedAssetAssignmentOffboardingForm from '../modules/fixed-assets/components/assignments/FixedAssetAssignmentOffboardingForm.vue';
-import FixedAssetStructuresIndex from '../modules/fixed-assets/components/structures/FixedAssetStructuresIndex.vue';
-import FixedAssetStructureForm from '../modules/fixed-assets/components/structures/FixedAssetStructureForm.vue';
-import FixedAssetStructureDetails from '../modules/fixed-assets/components/structures/FixedAssetStructureDetails.vue';
import RolesIndex from '../modules/users/components/RoleIndex.vue';
import RoleForm from '../modules/users/components/RoleForm.vue';
@@ -324,42 +321,6 @@ const routes: RouteRecordRaw[] = [
}
]
},
- {
- path: 'structures',
- name: 'FixedAssetStructures',
- component: FixedAssetStructuresIndex,
- meta: {
- title: 'Estructuras de Activos',
- requiresAuth: true
- }
- },
- {
- path: 'structures/create',
- name: 'FixedAssetStructuresCreate',
- component: FixedAssetStructureForm,
- meta: {
- title: 'Crear Estructura de Activo',
- requiresAuth: true
- }
- },
- {
- path: 'structures/:id/edit',
- name: 'FixedAssetStructuresEdit',
- component: FixedAssetStructureForm,
- meta: {
- title: 'Editar Estructura de Activo',
- requiresAuth: true
- }
- },
- {
- path: 'structures/:id',
- name: 'FixedAssetStructuresDetails',
- component: FixedAssetStructureDetails,
- meta: {
- title: 'Detalle de Estructura de Activo',
- requiresAuth: true
- }
- }
]
},
{